Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

bsemfree(2)

bsemget(2)

bsemwakeup(2)

lockbinsem(3C)

bsemwait(2)

NAME

bsemwait − wait for a binary semaphore to become unlocked

SYNOPSIS

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/bsem.h>
 int bsemwait (bsemid, binsem)
int bsemid;
struct binsem ∗binsem;

DESCRIPTION

Bsemid is a binary semaphore identifier obtained from a bsemget call, and binsem is the address of the corresponding binary semaphore.  bsemwait returns when the binary semaphore is no longer locked (i.e. when binsem->locked is set to 0). 

RETURN VALUE

Upon successful completion a value of 0 is returned.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

ERRORS

bsemwait will fail if one or more of the following are true:

­[EPERM] The calling process does not have write access to bsemid. This error will only be checked for and returned on non-real-time systems.

­[EFAULT] Binsem points outside the process’s allocated address space or is not aligned on a 4-byte boundary. 

­[EINVAL] Bsemid is not a valid binary semaphore identifier. 

­[EINTR] A signal was caught during the bsemwait system call. 

NOTES

It is expected that the only use of this system service will be in the lockbinsem(3C) library routine. 

The interface to this system service is subject to change. 

SEE ALSO

bsemfree(2), bsemget(2), bsemwakeup(2), lockbinsem(3C)

CX/UX Programmer’s Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026