sem_getvalue man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

sem_getvalue(2)						       sem_getvalue(2)

NAME
       sem_getvalue  - get the value of a POSIX semaphore

SYNOPSIS
DESCRIPTION
       is used to read the value of the semaphore.  The value of the semaphore
       specified by sem is read, at some unspecified time during the call, and
       then  stored  into sval.	 If the semaphore value is <= 0, at that time,
       the semaphore is considered unavailable.	 If the semaphore value	 is  >
       0, at that time, the semaphore is considered available.

       If  sval	 is  positive, it is equal to the number of locks available on
       the semaphore, at the time the semaphore value was read.	  If  sval  is
       negative,  its absolute value is equal to the number of blocked threads
       waiting for the semaphore to become available, at the  time  the	 sema‐
       phore value was read.

       If  the	specified  semaphore  referred to by sem is a named semaphore,
       then this semaphore must have been opened by the calling	 process  with
       and the process must have read permission on this semaphore.

       To use this function, link in the realtime library by specifying on the
       compiler or linker command line.

EXAMPLES
       The following call to will read the value of   the  semaphore  sem  and
       store it in sval.

RETURN VALUE
       A successful call to will return 0.  Otherwise, the call to will return
       -1 with errno set to the appropriate value of the error condition.

ERRORS
       fails and does not perform the requested operation if any of  the  fol‐
       lowing conditions are encountered:

	      [EPERM]	     The  calling process does not have the privileges
			     necessary to read the semaphore.

	      [EINVAL]	     The argument sem does not refer to a valid	 sema‐
			     phore.

SEE ALSO
       sem_open(2), <semaphore.h>.

STANDARDS CONFORMANCE
							       sem_getvalue(2)
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net