HP-UX Reference (11i v1 00/12) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man9/!!!intro.9
________________________________________________________________
___ ___
s
glossary(9) glossary(9)
Semaphore identifiers can be created using ftok(3C).
sem_perm is a ipc_perm structure that specifies the semaphore operation permission (see
below). This structure includes the following members:
ushort cuid; /* creator user id */
ushort cgid; /* creator group id */
ushort uid; /* user id */
ushort gid; /* group id */
ushort mode; /* r/a permission */
The value of sem_nsems is equal to the number of semaphores in the set. Each sema-
phore in the set is referenced by a positive integer referred to as a sem_num. sem_num
values run sequentially from 0 to the value of sem_nsems minus 1. sem_otime is the
time of the last semop(2) operation, and sem_ctime is the time of the last semctl(2)
operation that changed a member of the above structure.
A semaphore is a data structure that contains the following members:
ushort semval; /* semaphore value */
short sempid; /* pid of last operation */
ushort semncnt; /* # awaiting semval > cval */
ushort semzcnt; /* # awaiting semval = 0 */
semval
is a nonnegative integer. sempid is equal to the process ID of the last process
that performed a semaphore operation on this semaphore. semncnt is a count of the
number of processes that are currently suspended awaiting this semaphore’s
semval to
become greater than its current value.
semzcnt is a count of the number of processes
that are currently suspended awaiting this semaphores semval
to become zero.
semaphore operation permissions
In the semop(2) and semctl(2) system call descriptions, the permission required for an
operation is indicated for each operation. Whether a particular process has these permis-
sions for an object is determined by the object’s permission mode bits as follows:
00400 Read by user
00200 Alter by user
00060 Read, Alter by group
00006 Read, Alter by others
Read and Alter permissions on a semid are granted to a process if one or more of the fol-
lowing are true:
The process’s effective user ID is superuser.
The process’s effective user ID matches
sem_perm.[c]uid in the data structure
associated with semid and the appropriate bit of the ‘‘user’’ portion (0600) of
sem_perm.mode is set.
The process’s effective user ID does not match sem_perm. [c]uid and the
appropriate bit of the ‘‘group’’ portion (060) of sem_perm.mode is set.
The process’s effective user ID does not match
sem_perm.[c]uid and the
process’s effective group ID does not match
sem_perm.[c]gid and neither of
sem_perm.[c]gid is in the processs group access list and the appropriate bit of
the ‘‘other’’ portion (06) of sem_perm.mode
is set.
Otherwise, the corresponding permissions are denied.
semid See semaphore identifier.
session Each process group is a member of a session. A process is considered to be a member of the
session of which its process group is a member. A newly created process joins the session of
its creator. A process can alter its session membership (see setsid(2)). A session can have
multiple process groups (see setpgid(2)).
session leader
A process that has created a session (see setsid(2)).
session lifetime
The period between when a session is created and the end of the lifetime of all process
HP-UX Release 11i: December 2000 18 Section 919
___
___