_lwp_sema_trywait(2) _lwp_sema_trywait(2)
NAME
_lwp_sema_trywait - conditionally acquire the semaphore
SYNOPSIS
#include <synch.h>
int _lwp_sema_trywait(_lwp_sema_t *sema);
Parameters
sema
DESCRIPTION
_lwp_sema_trywait makes a single attempt to acquire the
semaphore sema, but does not block in the case of a failure.
sema Parameter
sema must have been previously initialized, either by
_lwp_sema_init or statically (see _lwp_sema_init).
Return Values
_lwp_sema_trywait returns zero for success and an error number
for failure, as described below.
Errors
If any of the following conditions is detected,
_lwp_sema_trywait fails and returns the corresponding value:
EBUSY The semaphore is in the locked state.
EFAULT The sema parameter points to an illegal address.
(This error may not be detected; a SIGSEGV signal may
be posted to the faulting lightweight processs (LWP)
if an illegal address is used.)
REFERENCES
_lwp_sema_init(2), _lwp_sema_post(2), _lwp_sema_wait(2),
sema_destroy(3synch), sema_init(3synch), sema_post(3synch),
sema_trywait(3synch), sema_wait(3synch)
NOTICES
Lightweight processes (LWPs) are internal interfaces and are
subject to change. Their use should be avoided.
Copyright 1994 Novell, Inc. Page 1