#include <semaphore.h> #include <qlg.h> int QlgSem_unlink(const Qlg_Path_Name_T *name);
The QlgSem_unlink() function, like the sem_unlink() function, unlinks a named semaphore. The QlgSem_unlink() function takes a pointer to a Qlg_Path_Name_T structure, while the sem_unlink() function takes a pointer to a character string.
Limited information on the name parameter is provided in this API. For additional information on the name parameter, authorities required, return values, and related information, see sem_unlink()--Unlink Named Semaphore.
If QlgSem_unlink() is not successful, errno usually indicates the following error or one of the errors identified in sem_unlink()--Unlink Named Semaphore.
Note: All of the related information for sem_unlink() applies to QlgSem_unlink(). See Related Information in sem_unlink().
See Code disclaimer information for information pertaining to code examples.
The following example unlinks the named semaphore "/mysem".
#include <semaphore.h> #include <qlg.h> main() { int rc; #define mypath "/mysem" const char US_const[3]= "US"; const char Language_const[4]="ENU"; const char Path_Name_Del_const[2]= "/"; typedef struct pnstruct { Qlg_Path_Name_T qlg_struct; char[100] pn; /* This size must be >= the path */ /* name length or be a pointer */ /* to the path name. */ }; struct pnstruct path; /***************************************************************/ /* Initialize Qlg_Path_Name_T parameters */ /***************************************************************/ memset((void*)path name, 0x00, sizeof(struct pnstruct)); path.qlg_struct.CCSID = 37; memcpy(path.qlg_struct.Country_ID,US_const,2); memcpy(path.qlg_struct.Language_ID,Language_const,3); path.qlg_struct.Path_Type = QLG_CHAR_SINGLE; path.qlg_struct.Path_Length = sizeof(mypath)-1; memcpy(path.qlg_struct.Path_Name_Delimiter,Path_Name_Del_const,1); memcpy(path.pn,mypath,sizeof(mypath)); rc = QlgSem_unlink((Qlg_Path_Name_T *)path name); }
Top | UNIX-Type APIs | APIs by category |