*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> usvsema (3p)              
Title
Content
Arch
Section
 

Contents


USVSEMA(3P)							   USVSEMA(3P)


NAME    [Toc]    [Back]

     usvsema - release a semaphore

C SYNOPSIS    [Toc]    [Back]

     #include <ulocks.h>

     int usvsema (usema_t *sema);

DESCRIPTION    [Toc]    [Back]

     usvsema increments	the count associated with sema.	 If there are any
     processes queued waiting for the semaphore	the first one is awakened.
     usvsema uses the usema(7M)	device to reactivate a suspended process.  If
     the process to be awoken is no longer alive, usvsema will automatically
     attempt to	awaken the next	process	waiting	for the	semaphore.

     In	order to use a semaphore, the caller must have joined the shared arena
     out of which the semaphore	is allocated (via usinit(3P)), and have	a file
     descriptor	to a usema device to unsuspend any waiting processes.  As a
     convenience, usvsema will automatically do	this for members of a share
     group, or for related (via	fork(2)) processes.  This automatic facility
     can generate the same errors as usinit(3P), and usopenpollsema(3P).
     These errors will be passed back to the caller.  If tracing is enabled
     (see usinit(3P)) then any errors will cause a message to be printed to
     stderr.  To avoid these errors and	therefore not need to check for	errors
     on	every uvpsema call, have each process call usinit(3P) and each user of
     a pollable	semaphore call usopenpollsema(3P).

     The following error can always occur:

     [EBADF]	    The	underlying file	descriptor for the semaphore was
		    closed or re-used by the application.

SEE ALSO    [Toc]    [Back]

      
      
     uscpsema(3P), usinit(3P), usinitsema(3P), usnewsema(3P),
     usnewpollsema(3P),	usopenpollsema(3P), uspsema(3P), ustestsema(3P),
     usema(7M).

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion	the semaphore has been released	and a value of
     0 is returned.  On	error, -1 is returned and errno	is set to indicate the
     error.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
sem_post IRIX release a posix named or unnamed semaphore
bus_release_resource FreeBSD release resources on a bus
gss_delete_sec_context Tru64 Release a security context.
release OpenBSD building an OpenBSD release
t_sndrel HP-UX initiate an orderly release
t_sndrel IRIX initiate an orderly release
svr4 FreeBSD System V Release 4 ABI support
release FreeBSD release building infrastructure
cpusetFreeQueueDef IRIX release memory used by a cpuset_QueueDef_t structure
relnotes IRIX on-line release notes viewer
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service