A new set containing semaphores is created if either is equal to IPC_PRIVATE, or does not have a semaphore set associated with it, and the IPC_CREAT bit is set in
If a new set of semaphores is created, the data structure associated with it (the structure, see is intialized as follows: and are set to the effective uid of the calling process. and are set to the effective gid of the calling process. is set to the lower 9 bits of is set to the value of is set to the current time is set to 0
A semaphore set associated with exists, but has fewer semaphores than the number specified in A new set of semaphores could not be created because the system limit for the number of semaphores or the number of semaphore sets has been reached. IPC_CREAT was not set in and no semaphore set associated with was found.