Open System Services System Calls Reference Manual (G06.25+, H06.03+)
semctl(2) OSS System Calls Reference Manual
SETALL Sets the respective values of all semaphores in the set to the values specified in
the array pointed to in the fourth parameter (arg.array). When this operation
successfully executes, the system clears the semaphore’s adjust-on-exit value in
all processes that have a semadj value for this semaphore. It also wakes up all |
processes that are waiting on a semaphore when the value of semzcnt or |
semncnt is greater than zero, depending on whether the respective value of a |
specific semaphore is set to zero or a positive integer respectively. |
This operation requires alter access permission.
The following interprocess communications (IPC) commands can also be used as values for
cmd:
IPC_RMID Removes the semaphore set ID and destroys the set of semaphores and the
semid_ds structure associated with it.
This is a restricted operation. The effective user ID of the calling process must
be either the super ID or equal to the value of the sem_perm.cuid or
sem_perm.uid field in the associated semid_ds structure.
IPC_SET Sets the semaphore set by copying selected user-supplied values in the structure
pointed to in the fourth parameter (arg.buf) into corresponding fields in the
semid_ds structure associated with the semaphore set ID.
This is a restricted operation. The calling process must either have appropriate
privileges, be the process that created the semaphore set, or be the process that
currently owns the semaphore set.
The fields are set as follows:
• The sem_perm.uid field is set as specified in the uid field of the
semid_ds ipc_perm structure pointed to in the fourth parameter
(arg.buf).
• The sem_perm.gid field is set as specified in the gid field of the
semid_ds ipc_perm structure pointed to in the fourth parameter
(arg.buf).
• The sem_perm.mode field is set to the access modes for the semaphore
set. Only the low-order nine bits are set.
• The sem_ctime field is updated.
IPC_STAT Queries the semaphore set ID by copying the contents of its associated semid_ds
structure into the structure pointed to in the fourth parameter (arg.buf). This
operation requires read access permission.
Use From the Guardian Environment
If called from a Guardian process, the actions of this function are undefined and errno is set to
[ENOTOSS].
RETURN VALUES
Upon successful completion, the value returned depends on the value of the cmd parameter as
follows:
GETNCNT Returns the value of the semncnt field from the semid_ds structure.
7−12 Hewlett-Packard Company 527186-003