semid_ds man page on Tru64

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
Tru64 logo
[printable version]

semid_ds(4)							   semid_ds(4)

NAME
       semid_ds - Defines a semaphore set

SYNOPSIS
       #include <sys/sem.h>

       struct semid_ds(
	       struct ipc_perm sem_perm,
	       struct sem *sem_base,
	       u_short sem_nsems,
	       time_t sem_otime,
	       time_t sem_ctime );

DESCRIPTION
       The  semid_ds structure defines a semaphore set associated with a sema‐
       phore ID. There is one semaphore set per semaphore ID.

       A semaphore set is implemented as an  array  of	sem_nsems  semaphores,
       with sem_base pointing to the first semaphore in the set.

       The  IPC permissions for a semaphore set are implemented in a separate,
       but associated, ipc_perm structure.

       A semaphore set	is  created  indirectly	 by  the  semget()  call.   If
       semget()	 is  called with a non-existent semaphore ID, the kernel allo‐
       cates a new semid_ds structure, initializes it, and returns  the	 sema‐
       phore ID that is to be associated with the semaphore set.

       The  following  sections	 describe the fields in the semid_ds structure
       and show the associated ipc_perm and sem_perm structures.

FIELDS
       The ipc_perm structure that defines permissions	for  semaphore	opera‐
       tions.	A pointer to the first semaphore in the set.  Individual sema‐
       phores are defined using the sem structure.  The number	of  semaphores
       in  the set.  Each semaphore in the set is referenced by a unique inte‐
       ger.  A semaphore number is sometimes referred to as sem_num, but  this
       is  not	a field carried in any of the relevant data structures.	 Sema‐
       phore numbers run sequentially from zero to sem_nsems-1.	 The  time  of
       the  last  semop() operation on the set.	 The time of the last semctl()
       operation that changed a member of the ipc_perm structure specified  by
       the sem_perm field.

ASSOCIATED STRUCTURES
       The  sem_perm  field  identifies the associated ipc_perm structure that
       defines the permissions for  operations	on  the	 semaphore  set.   The
       ipc_perm structure (from the sys/ipc.h header file) is as follows:

       struct ipc_perm {
	       ushort	 uid;	     /* owner's user id		   */
	       ushort	 gid;	     /* owner's group id	   */
	       ushort	 cuid;	     /* creator's user id	   */
	       ushort	 cgid;	     /* creator's group id	   */
	       ushort	 mode;	     /* access modes		   */
	       ushort	 seq;	     /* slot usage sequence number */
	       key_t	 key;	     /* key			   */ };

       The mode field is a 9-bit field that contains the permissions for sema‐
       phore operations.  The first three bits identify owner permissions; the
       second  three  bits identify group permissions; and the last three bits
       identify other permissions.  In each group,  the	 first	bit  indicates
       read  permission;  the  second  bit indicates write permission; and the
       third bit is not used.

       Individual semaphores are implemented with the following sem  structure
       (defined in the sys/sem.h header file):

       struct sem {
	      u_short	semval;
	      short	sempid;
	      u_short	semncnt;
	      u_short	semzcnt; };

       The  fields  in the sem structure are as follows: A nonnegative integer
       that is the current value of the semaphore.  The process ID of the last
       process	to  perform an operation on the semaphore.  The number of pro‐
       cesses that are currently suspended while waiting for an	 operation  to
       increment  the  current semval value.  The number of processes that are
       currently suspended while waiting for semval to go to zero.

SEE ALSO
       Functions: semctl(2), semget(2), semop(2)

								   semid_ds(4)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Tru64

List of man pages available for Tru64

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net