DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

latch_getvalue(S-osr5)


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-osr5).

See also

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

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.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005