sema_trywait man page on Tru64

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
Tru64 logo
[printable version]



sema_trywait(3scl)					    sema_trywait(3scl)

NAME
       sema_trywait  -	Test and conditionally decrement (lock) a semaphore if
       the semaphore count is greater than 0.

LIBRARY
       SCL Threads Library (libthread.so)

SYNOPSIS
       #include <synch.h>

       int sema_trywait(
			 sema_t *semp );

PARAMETERS
       Pointer to the semaphore to be conditionally decremented.

DESCRIPTION
       This routine atomically tests the value of the semaphore	 count	field:
       if  it is greater than 0, the count is decremented and a status of 0 is
       returned.  if it is 0, a status of EBUSY is returned.

       This routine is a non-blocking version of sema_wait(3scl).

SCL IMPLEMENTATION NOTES
       sema_trywait(3scl) is implemented by calling sem_trywait(3).

RETURN VALUES
       If an error condition occurs, this routine  returns  an	integer	 value
       indicating the type of error.

       Additional  error  return  information  may be written to the SCL error
       log.  Refer to scl_error_log(4scl) for details.

       Possible return values are as follows: Successful completion.  The sem‐
       aphore  count  value  is	 zero, meaning that it is in use (locked).  An
       error-mapping message is written to the SCL errorlog  because  sem_try‐
       wait(3)	returned  EAGAIN, which has been mapped to EBUSY.  An internal
       implementation error occurred. Refer to the SCL errorlog for additional
       information.

       Note:  EFAULT is not returned if semp is an illegal address. An illegal
       address generates a SIGSEGV signal, which by  default  will  abort  the
       process and generate a core dump.

ERRORS
       None.

RELATED INFORMATION
       Functions:   scl_intro(3scl),   scl_thread_intro(3scl),	sem_trywait(3)
       sema_destroy(3scl), sema_init(3scl), sema_post(3scl), sema_wait(3scl)

       Files: scl_error_log(4scl)

       Manuals: Solaris Compatibility Libraries User's Guide

							    sema_trywait(3scl)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Tru64

List of man pages available for Tru64

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