Guardian Procedure Calls Reference Manual

Returned Value
INT
Outcome of the call:
No error.0
Bounds error. The semid parameter cannot be written to by the calling process.22
Required parameter missing. The semid and security parameters must be specified.29
Either the process or the processor has reached the maximum number of user semaphores it can open
concurrently. The corresponding errno value is ENOENT.
NOTE: The number of binary semaphores a processor can have open on systems running H06.17 and later
H-series RVUs and J06.06 and later J-series RVUs is 65536. On earlier RVUs, the limit is 64.
4002
Invalid parameter. The security parameter is not a valid value. Specifying an invalid value for security
could cause unpredictable results in future RVUs. The corresponding errno value is EINVAL.
4022
Process cannot open the binary semaphore. The process has reached the maximum number of binary
semaphores it can open. The corresponding errno value is EMFILE.
4024
No space. The processor has reached the maximum limit of space available for binary semaphores. The
corresponding errno value is ENOSPC.
4028
General Considerations for Binary Semaphores
Binary semaphore attributes
Owner. The owner of a binary semaphore is the process access ID of the process that
calls the BINSEM_CREATE_ procedure. The owner of a binary semaphore is defined by
a group number and a member number. The owner is relevant only in the context of
security; it is neither specified nor returned by the binary semaphore procedures.
Security. The security of a binary semaphore determines whether it can be opened by
any process, a process belonging to the owner's group, or a process belonging to the
owner. Once a binary semaphore has been created, its security cannot be altered.
Identifying a binary semaphore
Binary semaphore ID. A binary semaphore ID identifies each instance of an open of a
binary semaphore. A binary semaphore can have multiple openers.
Process handle. A process handle is used in conjunction with a binary semaphore ID to
identify a binary semaphore opened by another process.
Three binary semaphore states
Locked. A binary semaphore can be locked by a process. Only one process at a time
can hold the lock on a binary semaphore.
Unlocked. A binary semaphore can have no lock on it.
Forsaken. A binary semaphore can be forsaken if it was locked by a process that has
terminated.
Binary semaphore operations
Operations on a binary semaphores are atomic: they finish one at a time and never finish
concurrently. These procedures perform operations on binary semaphores:
BINSEM_CREATE_ which creates, opens, and locks a binary semaphore. A binary
semaphore ID is returned for use with other operations.
BINSEM_OPEN_ which opens access to a binary semaphore. A binary semaphore ID is
returned for use with other operations.
BINSEM_CREATE_ Procedure 89