|
|
coherent
sem Device Driver sem
Semaphore device driver
/dev/sem is an interface to the semaphore device driver. It is
assigned major device 23 (minor device 0) and can be accessed as
a character-special device.
All semaphore operations are performed through the COHERENT sys-
tem call ioctl. The operations semctl, semget, and semop are
performed with an integer parameter array. The first element of
the array is reserved for the return value (default -1). Subse-
quent elements represent arguments. The call to ioctl passes
SEMCTL, SEMGET, or SEMOP as the second argument, and the
parameter array as the third argument. The first argument is an
open file descriptor to /dev/sem.
***** Access *****
Prior to accessing the devices, a entry must be created in /dev,
as follows:
/etc/mknod /dev/sem c 23 0
chmod 666 /dev/sem
***** Bugs ***** Allocation of too many semaphore ids (NNSSEEMMIIDD) or
semaphores per identifier (NNSSEEMM) can exhaust kernel data space,
which will stop the system in its tracks.
Private semaphore sets are not supported. Semaphore ids must be
removed manually when no longer required. To remove all
semaphore identifiers, use the following code:
#include <sys/sem.h>
#define NSEMID 16
semget( 0, 0 ); /* must do first */
for ( id=0; id < NSEMID; ++id )
semctl( id, 0, IPC_RMID, 0 );
To load the driver sem into memory, use the command drvld.
***** Files *****
/uussrr/iinncclluuddee/ssyyss/iippcc.hh
/uussrr/iinncclluuddee/ssyyss/sseemm.hh
/ddeevv/sseemm -- Device
/ddrrvv/sseemm -- Loadable device driver
COHERENT Lexicon Page 1
sem Device Driver sem
***** See Also *****
device drivers, drvld, semctl(), semget(), semop()
COHERENT Lexicon Page 2
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.