opens a semaphore
cc ... -lx
int opensem (sem_name)
opens a semaphore named by
and returns the unique semaphore identification number
should always be called to initialize the semaphore before the
first attempt to open it.
can only be used to open semaphores created under UNIX
version 3.0, not for UNIX System V semaphores.
returns a value of -1 if an error occurs.
If the semaphore named does not exist,
is set to ENOENT.
If the file specified is not a semaphore file (i.e.,
a file previously created by a process using a call to
is set to ENOTNAM.
If the semaphore has become invalid due to inappropriate use,
is set to ENAVAIL.
This feature is a
specific enhancement which may
not be present in all
It is not advisable to open the same semaphore more than once. Although
it is possible to do this,
it may result in a serious deadlock.
opensem is not part of any currently supported standard;
it is an extension of AT&T System V provided by the Santa Cruz Operation.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003