Standard C Library Functions semunlink(3C)
NAME
semunlink - remove a named semaphore
SYNOPSIS
#include
int semunlink(const char *name);
DESCRIPTION
The semunlink() function removes the semaphore named by the
string name. If the semaphore named by name is currently
referenced by other processes, then semunlink() has no
effect on the state of the semaphore. If one or more
processes have the semaphore open when semunlink() is
called, destruction of the semaphore is postponed until all
references to the semaphore have been destroyed by calls to
semclose(3C), Exit(2), or one of the exec functions (see
exec(2)) . Calls to semopen(3C) to re-create or re-connect
to the semaphore refer to a new semaphore after
semunlink() is called. The semunlink() call does not
block until all references have been destroyed; it returns
immediately.
RETURN VALUES
Upon successful completion, semunlink() returns 0. Other-
wise, the semaphore is not changed and the function returns
a value of -1 and sets errno to indicate the error.
ERORS
The semunlink() function will fail if:
EACES Permission is denied to unlink the named
semaphore.
ENAMETOLONG The length of name string exceeds PATHMAX,
or a pathname component is longer than
NAMEMAX while POSIXNOTRUNC is in
effect.
ENOENT The named semaphore does not exist.
ENOSYS The semunlink() function is not supported
by the system.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 5 Feb 2008 1
Standard C Library Functions semunlink(3C)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level MT-Safe
Standard See standards(5).
SEE ALSO
exec(2), exit(2), semclose(3C), semopen(3C), attri-
butes(5), standards(5)
NOTES
Solaris 2.6 was the first release to support the Asynchro-
nous Input and Output option. Prior to this release, this
function always returned -1 and set errno to ENOSYS.
SunOS 5.11 Last change: 5 Feb 2008 2
|