NWExamineSemaphore(3nw)


NWExamineSemaphore -- returns the semaphore value

Synopsis

   #include <nwsync.h> 
   or 
   #include <nwcalls.h> 
   

NWCCODE N_API NWExamineSemaphore (NWCONN_HANDLE conn, nuint32 semHandle, pnint16 semValue, pnuint16 semOpenCount);

Description

The parameters are as follows:

conn
(IN) Specifies the NetWare server connection handle.

semHandle
(IN) Specifies the semaphore handle obtained when the semaphore was opened by NWOpenSemaphore.

semValue
(OUT) Points to the current semaphore value (optional).

semOpenCount
(OUT) Points to the number of stations that currently have this semaphore open.

Return values

0x0000
SUCCESSFUL

0x8801
INVALID_CONNECTION

0x89FF
LOCK_ERROR

Notices

A semaphore value greater than 0 indicates the application can access the associated network resource. A negative value indicates the number of processes waiting to use the semaphore. If the semaphore value is negative, the application must either enter a waiting queue by calling NWWaitOnSemaphore or temporarily abandon its attempt to access the network resource.

semOpenCount indicates the number of processes holding the semaphore open. NWOpenSemaphore increments this value. NWCloseSemaphore decrements this value.

semValue is optional. Use NULL if a return value is not desired.

Services

Synchronization

NCP calls

0x2222 32 1
Examine Semaphore

References

NWCloseSemaphore(3nw), NWOpenSemaphore(3nw), NWSignalSemaphore(3nw), NWWaitOnSemaphore(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.