0 | NO_ERROR | Semaphore
opened successfully |
6 | ERROR_INVALID_HANDLE | Error, The value in phmuxSemaphore does not point to a valid
semaphore |
8 | ERROR_NOT_ENOUGH_MEMORY | Error, The system memory limit has been exceeded |
87 | ERROR_INVALID_PARAMETER | Error, One or more parameters is not recognized, See parameters above,
Both pszSemaphoreName and phmuxSemaphore may be NULL |
105 | ERROR_SEM_OWNER_DIED | Error, The owner of the semaphore has died without freeing the
semaphore |
123 | ERROR_INVALID_NAME | Error, The name pointed to by pszSemaphoreName has been rejected
by the file system |
187 | ERROR_SEM_NOT_FOUND | Error, There is no semaphore with the name in
pszSemaphoreName |
291 | ERROR_TOO_MANY_OPENS | Error, The usage count for the semaphore in question has exceeded the
system limit of 65535 |
Include Info
#define INCL_DOSSEMAPHORES
#include <os2.h>
Usage Explanation
DosOpenMuxWaitSem gains access to a shared MuxWait semaphore.
Relevant Structures
Gotchas
The process that created the MuxWait semaphore does not need to call this.
The process wishing to use this function must first have gained access to
all semaphores in the muxwait list of the MuxWait semaphore to which access is
intended or ERROR_INVALID_HANDLE will be returned.
Sample Code
#define INCL_DOSSEMAPHORES
#include
UCHAR SemName[15];
PMUX phmuxMySemaphore= NULL; /* pointer to my semaphore handle */
/* a shared MuxWiat semaphore is successfully created in another process */
/* its name happens to be \SEM32\MySem */
strcpy(SemName,"\\SEM32\\MySem");
rc = DosOpenMuxWaitSem(SemName, phmuxMySemaphore);
if (rc != 0)
{
/* We got an error to take care of. */
}
See Also
DosAddMuxWaitSem,
DosCloseMuxWaitSem,
DosCreateMuxWaitSem
DosDeleteMuxWaitSem,
DosQueryMuxWaitSem,
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 |
DosOpenMuxWaitSem |