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

  man pages->Tru64 Unix man pages -> sem_close (3)              
Title
Content
Arch
Section
 

sem_close(3)

Contents


NAME    [Toc]    [Back]

       sem_close  -  Deallocates  the  specified  named semaphore
       (P1003.1b)

SYNOPSIS    [Toc]    [Back]

       #include <semaphore.h>

       int sem_close ( sem_t *sem) ;


LIBRARY    [Toc]    [Back]

       Realtime Library (librt.so, librt.a)

PARAMETERS    [Toc]    [Back]

       References the semaphore to be closed.  Use the sem  argument
 returned by the previous call to sem_open.

DESCRIPTION    [Toc]    [Back]

       The  sem_close  function  makes  a semaphore available for
       reuse by deallocating any system resources  allocated  for
       use  by  the current process for the named semaphore indicated
 by sem.

       If the semaphore has not  been  removed  with  a  call  to
       sem_unlink, sem_close does not change the current state of
       the semaphore.

       If  the  semaphore  has  been  removed  with  a  call   to
       sem_unlink  after  the  most  recent call to sem_open with
       O_CREAT, the semaphore is no longer  available  after  all
       processes that opened the semaphore close it.

RETURN VALUES    [Toc]    [Back]

       On  a  successful  call,  a value of 0 (zero) is returned.
       Otherwise, a value of -1 is returned and errno is  set  to
       indicate that an error occurred.

ERRORS    [Toc]    [Back]

       The  sem_close  function  fails under the following condition:
 The sem argument is not a valid  semaphore  descriptor.

SEE ALSO    [Toc]    [Back]

      
      
       Functions: sem_init(3), sem_open(3), sem_unlink(3)

       Guide to Realtime Programming



                                                     sem_close(3)
[ Back ]
 Similar pages
Name OS Title
sem_unlink Tru64 Removes the specified named semaphore (P1003.1b)
sem_open Tru64 Opens/creates a named semaphore for use by a process (P1003.1b)
timer_delete Tru64 Deallocates a previously allocated per-process timer (P1003.1b)
sem_getvalue Tru64 Gets the value of a specified semaphore (P1003.1b)
sem_post Tru64 Unlocks a semaphore (P1003.1b)
sem_destroy Tru64 Destroys an unnamed semaphore (P1003.1b)
sem_init Tru64 Initializes an unnamed semaphore (P1003.1b)
sem_close OpenBSD named semaphore operations
sem_unlink FreeBSD named semaphore operations
sem_close FreeBSD named semaphore operations
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service