msem_lock 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]

msem_lock(2)							  msem_lock(2)

NAME
       msem_lock() - lock a semaphore

SYNOPSIS

DESCRIPTION
       attempts to lock a binary semaphore.

       sem points to an structure which specifies the semaphore to be locked.

       If  the	semaphore  is  not currently locked, it becomes locked and the
       function returns successfully.

       If the semaphore is currently locked, and condition is then  the	 func‐
       tion  returns  with an error.  If the semaphore is currently locked and
       condition is zero, the function does not return until either the	 call‐
       ing  process  is	 able  to successfully lock the semaphore, or an error
       condition occurs.

       All calls to and by  multiple  processes	 sharing  a  common  structure
       behave as if the calls were serialized.

       If  the	structure contains any value not resulting from a call to fol‐
       lowed by a (possibly empty) sequence of calls to and  the  results  are
       undefined.   The	 address  of an uniquely identifies the semaphore.  If
       the structure contains any value copied from an structure at a  differ‐
       ent address, the result is undefined.

IMPLEMENTATION NOTES
       If  blocked  on	a  locked semaphore, suspends the calling process at a
       priority such that the process can be interrupted by a signal.

       The system attempts to ignore or recover from invalid values written to
       the structure, but this is not guaranteed for all cases.

       successfully  acquires a semaphore that is locked by a process that has
       exited.

RETURN VALUE
       returns one of the following values:

	      Success.

	      Failure.
		     is set to indicate the error.

ERRORS
       sets to one of the following values if the corresponding	 condition  is
       encountered.

	      was specified and the semaphore was already locked.

	      sem	     points  to an structure that has been removed, or
			     condition is invalid.

	      was interrupted by a signal that was caught.

	      The semaphore is currently locked,
			     condition is zero, and waiting to lock the	 sema‐
			     phore would create a deadlock.

	      sem	     is not a properly aligned address or is otherwise
			     an invalid pointer.

AUTHOR
       was developed by HP and OSF.

SEE ALSO
       msem_init(2), msem_remove(2), msem_unlock(2), mman(5).

STANDARDS CONFORMANCE
								  msem_lock(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