DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

latch_getvalue(S)


latch_getvalue -- get value of latch

Syntax

cc . . . -lsuds
#include <latch.h>

int latch_getvalue(latch_t *latch, unsigned int *sval);

Description

The latch_getvalue function updates the location referenced by sval to have the value of the latch referenced by latch without affecting the state of the latch. The updated value represents an actual latch value that occurred at some unspecified time during the call, but may not be the actual value of the latch when it returns to the calling process.

If latch is locked then the value returned in sval is LATCH_LOCKED; if unlocked, the value is !LATCH_LOCKED.

Return values

Upon successful completion, latch_getvalue returns the current state of the lock. Otherwise it returns -1 and sets errno to indicate the error.

Diagnostics

Errors returned are as for sem_getvalue(S).

See also

latch_close(S), latch_open(S), latch_post(S), latch_trywait(S), latch_unlink(S), latch_wait(S), sem_getvalue(S)

Standards conformance

latch_getvalue is not part of any currently supported standard; it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003