opensem(2XNX) (XENIX System Compatibility) opensem(2XNX)
NAME
opensem - (XENIX) open a semaphore
SYNOPSIS
cc [flag . . . ] flag . . . -lx
int opensem(char *sem_name);
DESCRIPTION
opensem opens a semaphore named by sem_name and returns the
unique semaphore identification number sem_num used by waitsem
and sigsem. creatsem should always be called to initialize
the semaphore before the first attempt to open it.
Return Values
opensem returns a value of -1 if an error occurs. If the
semaphore named does not exist, errno is set to ENOENT. If
the file specified is not a semaphore file (that is, a file
previously created by a process using a call to creatsem),
errno is set to ENOTNAM. If the semaphore has become invalid
due to inappropriate use, errno is set to ENAVAIL.
REFERENCES
creatsem(2XNX), sigsem(2XNX), waitsem(2XNX)
NOTICES
It is not advisable to open the same semaphore more than once.
Although it is possible to do this, it may result in a
deadlock.
Copyright 1994 Novell, Inc. Page 1