n Successful completion. The function returns a non-negative integer semaphore identifier. -1 Indicates an error. The function sets errno to one of the following values: o EACCES - A semaphore identifier exists for key, but operation permission as specified by the low-order 9 bits of semflg was not granted. o EEXIST - A semaphore identifier exists for key but ((semflg &IPC_CREAT) &&(semflg &IPC_EXCL)) is nonzero. o EFAULT - The arguments passed to the function are not accessible. o EINVAL - The value of nsems is either less than or equal to 0 or greater than the system-imposed limit, or 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 0. o ENOENT - A semaphore identifier does not exist for key and (semflg &IPC_CREAT) is equal to 0. o ENOSPC - A semaphore identifier is to be created but the system-imposed limit on the maximum number of allowed semaphores system-wide will be exceeded. o EVMSERR - OpenVMS specific nontranslatable error code.