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

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

sem_getvalue(3)

Contents


NAME    [Toc]    [Back]

       sem_getvalue  -  Gets  the  value of a specified semaphore
       (P1003.1b)

SYNOPSIS    [Toc]    [Back]

       #include <semaphore.h>

       int sem_getvalue ( sem_t *sem, int *sval);


LIBRARY    [Toc]    [Back]

       Realtime Library (librt.so, librt.a)

PARAMETERS    [Toc]    [Back]

       Specifies a pointer to the semaphore for which a value  is
       to  be returned.  References a location to be updated with
       the value of the semaphore indicated by the sem  argument.

DESCRIPTION    [Toc]    [Back]

       The sem_getvalue function updates a location referenced by
       the sval argument with the value of  semaphore  sem.   The
       updated  value  represents  an actual semaphore value that
       occurred during the call, but may not be the actual  value
       of the semaphore at the time that the value is returned to
       the calling process.

       If the semaphore is locked, the value returned will either
       be zero or a negative number indicating the number of processes
 waiting for the semaphore at some time  during  the
       call.

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_getvalue function fails under the following condition:
 The  sem  argument  does  not  refer  to  a  valid
       semaphore.

SEE ALSO    [Toc]    [Back]

      
      
       Functions: sem_post(3), sem_trywait(3), sem_wait(3)

       Guide to Realtime Programming



                                                  sem_getvalue(3)
[ Back ]
 Similar pages
Name OS Title
sem_post Tru64 Unlocks a semaphore (P1003.1b)
sem_unlink Tru64 Removes the specified named semaphore (P1003.1b)
sem_close Tru64 Deallocates the specified named semaphore (P1003.1b)
sem_init Tru64 Initializes an unnamed semaphore (P1003.1b)
sem_destroy Tru64 Destroys an unnamed semaphore (P1003.1b)
sem_open Tru64 Opens/creates a named semaphore for use by a process (P1003.1b)
sem_trywait Tru64 Performs (or conditionally performs) a semaphore lock (P1003.1b)
sem_wait Tru64 Performs (or conditionally performs) a semaphore lock (P1003.1b)
clock_getres Tru64 Gets the resolution for the specified clock (P1003.1b)
mq_unlink Tru64 Removes a message queue (P1003.1b)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service