DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

cdistributed(D3oddi)


cdistributed -- indicate character driver can have multiprocessor access

Syntax

#include <sys/arch.h>
#include <sys/conf.h>
#include <sys/types.h>

int cdistributed(dev_t dev, int flags);

Description

This function marks a character driver as being capable of multiprocessor access.

Arguments


dev
Device number

flags
Option mask ORed to the current flags defining processor access for the specified device. (The character device switch table is used by the kernel to access a character device driver.)

The following values may be ORed together in flags (defined in <sys/conf.h>) to mark the corresponding driver routines as being multithreaded:


DIST_CDEV_CLOSE
mark a driver's close(D2oddi) routine as multithreaded

DIST_CDEV_IOCTL
mark a driver's ioctl(D2oddi) routine as multithreaded

DIST_CDEV_OPEN
mark a driver's open(D2oddi) routine as multithreaded

DIST_CDEV_READ
mark a driver's read(D2oddi) routine as multithreaded

DIST_CDEV_WRITE
mark a driver's write(D2oddi) routine as multithreaded

Return values

On a multiprocessor system, cdistributed( ) always returns 1. On a uniprocessor system, cdistributed( ) always returns 0.

Usage

Context and synchronization

Initialization context

Hardware applicability

All

Version applicability

oddi: 2mp, 3mp, 4mp, 5mp, 6mp

SVR5 DDI compatibility

DDI does not support this function. See ``Multithreaded drivers'' in HDK Technical Reference for information about how multithreaded drivers are identified in DDI.

References

bdistributed(D3oddi), idistributed(D3oddi), sdistributed(D3oddi),

``Multithreaded drivers'' in HDK Technical Reference

Examples

The following example illustrates how cdistributed( ) is used to register the driver's read(D2oddi) and write(D2oddi) entry points as multithreaded:
   #include "sys/arch.h"
   #include "sys/conf.h"
   xxinit()
   {
          ...
          cdistributed(dev, DIST_CDEV_READ | DIST_CDEV_WRITE );
          ...
   }

19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005