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

  man pages->IRIX man pages -> sem_close (3c)              
Title
Content
Arch
Section
 

Contents


sem_close(3C)							 sem_close(3C)


NAME    [Toc]    [Back]

     sem_close - close a posix named semaphore

SYNOPSIS    [Toc]    [Back]

     #include <semaphore.h>

     int sem_close (sem_t *sem<b>);

DESCRIPTION    [Toc]    [Back]

     sem_close closes the connection to	the named semaphore located at address
     sem.  The address sem may reside anywhere in the calling processes
     address space, but	the process must have read and write access to sem.

     If	multiple threads within	a common process (i.e.,	sprocs,	pthreads) are
     sharing sem, a single call	to sem_close will close	the named semaphore
     for all threads within the	calling	process.

     Once a named semaphore has	been closed, subsequent	operations on the
     semaphore by the calling process will fail	until the semaphore has	been
     reopened.

     If	the calling process was	the last process to close the semaphore, and
     the semaphore has been unlinked via sem_unlink, then the named semaphore
     will cease	to exist.  Otherwise, the semaphore will persist.

     sem_close will fail if the	following is true:

     [EINVAL]	    The	semaphore located at address sem is not	a valid	posix
		    named semaphore.

SEE ALSO    [Toc]    [Back]

      
      
     sem_destroy(3C), sem_init(3C), sem_getvalue(3C), sem_post(3C),
     sem_wait(3C), sem_trywait(3C), sem_open(3C), sem_unlink(3C),
     shm_open(3C), mmap(3C)

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion, a value of 0 is returned to the calling
     process. Otherwise, a value of -1 is returned and errno is	set to
     indicate the error.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
sem_close HP-UX close a named POSIX semaphore
pipcrm HP-UX remove a POSIX message queue or a POSIX named semaphore
sem_getvalue IRIX get the value of a posix named or unnamed semaphore
sem_open IRIX open a posix named semaphore
sem_unlink IRIX deletes a posix named semaphore
sem_unlink HP-UX unlink a named POSIX semaphore
sem_open HP-UX create/open a named POSIX semaphore
sem_wait IRIX acquire a posix named or unnamed semaphore
sem_post IRIX release a posix named or unnamed semaphore
sem_getvalue HP-UX get the value of a POSIX semaphore
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service