int semget(key_t key, int nsems, int semflg);
Upon creation, the internal attributes associated with the new semaphore identifier are initialized as follows:
- sem_perm.cuid, sem_perm.uid, sem_perm.cgid and sem_perm.gid are set equal to the effective user ID and effective group ID, respectively, of the calling process.
- The access permission bits of sem_perm.mode are set equal to the access permission bits of semflg.
- sem_nsems is set equal to the value of nsems.
- sem_otime is set equal to 0 and sem_ctime is set equal to the current time.
You must explicitly remove semaphore identifiers after the last reference to them has been removed.
Specifies either IPC_PRIVATE or a system-wide unique key.
Is the number of semaphores in the set associated with the semaphore ID.
Is a flag indicating specific semaphore conditions and options to implement.
A semaphore identifier exists for key, but operation permission as specified by permission bits of semflg would not be granted.
A semaphore identifier exists for key but (semflg & IPC_CREAT) and (semflg & IPC_EXCL) are both non-zero.
A semaphore identifier exists for key, but the number of semaphores in the set associated with it is less than nsems, and nsems is not equal to zero.
nsems is either less than or equal to zero or greater than the system imposed limit.
A semaphore identifier does not exist for key and (semflg & IPC_CREAT) is zero.
A semaphore identifier is to be created but the system-imposed limit on the maximum number of allowed semaphore identifiers system wide would be exceeded.
NuTCRACKER Platform semaphores are not implemented in terms of Win32 semaphores; therefore, they cannot be shared with Win32 applications.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.1 patch 1 Documentation Build 2.