Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (s and S) semctl(2)
GETPID Returns the value of the sempid field from the semid_ds structure.
GETVAL Returns the value of the semval field from the semid_ds structure.
GETZCNT Returns the value of the semzcnt field from the semid_ds structure.
Upon successful completion, all other values of cmd return the value 0 (zero).
If the semctl() function fails, the value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the semctl() function sets errno to the corresponding
value:
[EACCES] The calling process does not have the required read or alter access.
[EFAULT] One of the following is true:
• The cmd parameter is IPC_STAT, and either the structure pointed to in
the fourth parameter (arg.buf) is not in the address space of the process
or the function cannot write into the structure pointed to in the fourth
parameter.
• The cmd parameter is GETALL, and either the structure pointed to in
the fourth parameter (arg.buf) is not in the address space of the process
or the function cannot write into the structure pointed to in the fourth
parameter.
[EINVAL] One of the following conditions is true:
• The semid parameter is not a valid semaphore set ID.
• The value of the semnum parameter is less than 0 (zero), or it is greater
than or equal to the value of the sem_nsems field in the semid_ds struc-
ture.
• The cmd parameter is not a valid operation.
[ENOTOSS] The calling process is not an OSS process. The requested operation is not sup-
ported from the Guardian environment.
[EPERM] All of the following conditions are true:
• The cmd parameter is equal to IPC_RMID or IPC_SET.
• The effective user ID of the calling process does not have appropriate
privileges.
• The effective user ID of the calling process is not equal to the value of
the sem_perm.cuid or sem_perm.uid field in the semid_ds structure
associated with the semaphore set ID.
[ERANGE] The cmd parameter is SETALL or SETVAL, and the semaphore value in the
semval field of the semid_ds structure associated with the semaphore set ID is
greater than the system-defined maximum.
527186-003 Hewlett-Packard Company 7−13