[ Home | Alpha index | Topic index | Tutorials | Download | Feedback ]

The OS/2 API Project

DosQueryMuxWaitSem

[ Syntax | Params | Returns | Include | Usage | Structs | Gotchas | Code | Also ]

Syntax

rc = DosQueryMuxWaitSem( hmuxSemaphore, pulSemaphoreRecords, pSemaphoreRecord, pflAttributes );

Parameters

HMUX hmuxSemaphore (input)
The handle of the MuxWait semaphore to be queried.

PULONG pulSemaphoreRecords (input/output)
For input, this points to a ULONG that contains the number of SEMRECORDs that may be returned in the SEMRECORD structure pointed to by pSemaphoreRecord. If this value is not enough to contain all SEMRECORDs from the MuxWait list then ERROR_PARAM_TOO_SMALL is returned and this value points to the number of records in the MuxWait list. For output, this value points to the number of SEMRECORDs actually returned.

PSEMRECORD pSemaphoreRecord (output)
A pointer to a buffer that will get the SEMRECORDs.

PULONG pflAttributes (output)
The attribute flags that were specified when this MuxWait semaphore was created.

Returns

APIRET rc
The following values can be returned
0NO_ERROROperation successful
6ERROR_INVALID_HANDLEError, The value in phmuxSemaphore does not point to a valid semaphore
8ERROR_NOT_ENOUGH_MEMORYError, The system memory limit has been exceeded
87ERROR_INVALID_PARAMETERError, One or more parameters is not recognized, See parameters above, Both pszSemaphoreName and phmuxSemaphore may be NULL
105ERROR_SEM_OWNER_DIEDError, The owner of the semaphore has died without freeing the semaphore
289ERROR_PARAM_TOO_SMALLError, The value pointed to by pulSemaphoreRecords is too small

Include Info

#define INCL_DOSSEMAPHORES
#include <os2.h>

Usage Explanation

DosQueryMuxWaitSem returns the semaphore records of the MuxWait semaphore referred to by hmuxSemaphore.

Relevant Structures

Gotchas

The process calling DosQueryMuxWaitSem must first obtain access to the semaphore in question or ERROR_INVALID_HANDLE will be returned.

Sample Code

#define INCL_DOSSEMAPHORES #include <os2.h> HMUX hmuxMySemaphore; /* my semaphore handle */ ULONG ulNumSemRecords=1; /* will get the request count for the sem */ SEMRECORD SemRecord; /* single SEMRECORD structure */ PULONG pflAttribs; /* pointer to attribute flags */ /* access is gained to the semaphore in question */ /* either by DosCreateMuxWaitSem ... */ /* ... or by DosOpenMuxWaitSem */ /* its handle is placed in hmuxMySemaphore */ rc = DosQueryMuxWaitSem( hmuxMySemaphore, ulNumSemRecords, &SemRecord, &pflAttribs ); if (rc != 0) { /* We got an error to take care of. */ }

See Also

DosAddMuxWaitSem, DosCloseMuxWaitSem, DosCreateMuxWaitSem DosDeleteMuxWaitSem, DosOpenMuxWaitSem, DosWaitMuxWaitSem

Author

Joe Phillips - jaiger@eng2.uconn.edu

Additions

Last modified July 21/1996
Please send all errors, comments, and suggestions to: timur@vnet.ibm.com

The OS/2 API Project

DosQueryMuxWaitSem