ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/ipcsemunu.htm

183 lines
5.3 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>QlgSem_unlink()--Unlink Named Semaphore (using NLS-enabled path
name)</title>
<!-- Begin Header Records -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- IPCSUNU SCR A converted by B2H R4.1 (346) (CMS) by V2CDIJAB at -->
<!-- RCHVMW2 on 15 Sep 2000 at 15:06:12 -->
<!-- Edited by Kersten Feb 02 -->
<!-- This file has undergone html cleanup on 05/01/02 by JET -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!--End Header Records -->
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<h2>QlgSem_unlink()--Unlink Named Semaphore (using NLS-enabled path name)</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax
<pre>
#include &lt;semaphore.h&gt;
#include &lt;qlg.h&gt;
int QlgSem_unlink(const Qlg_Path_Name_T *<em>name</em>);
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QP0ZPSEM<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>QlgSem_unlink()</strong> function, like the <strong>
sem_unlink()</strong> function, unlinks a named semaphore. The <strong>
QlgSem_unlink()</strong> function takes a pointer to a Qlg_Path_Name_T
structure, while the <strong>sem_unlink()</strong> function takes a pointer to
a character string.</p>
<p>Limited information on the <em>name</em> parameter is provided in this API.
For additional information on the <em>name</em> parameter, authorities
required, return values, and related information, see <a href="ipcsemun.htm">
sem_unlink()</a>--Unlink Named Semaphore.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>name</strong></dt>
<dd>(Input) A pointer a Qlg_Path_Name_T structure that contains a path name or
a pointer to a path name of the semaphore to be unlinked. For more information
on the Qlg_Path_Name_T structure, see <a href="../apiref/pns.htm">Path name
format</a>.</dd>
</dl>
<br>
<h3>Error Conditions</h3>
<p>If <strong>QlgSem_unlink()</strong> is not successful, <em>errno</em>
usually indicates the following error or one of the errors identified in <a
href="ipcsemun.htm">sem_unlink()</a>--Unlink Named Semaphore.</p>
<dl>
<dt><em>[ECONVERT]</em></dt>
<dd>A conversion error for the parameter <em>name</em>.</dd>
</dl>
<br>
<h3>Related Information</h3>
<ul>
<li>The &lt;<strong>qlg.h</strong>&gt; file (see <a href="unix13.htm">Header
Files for UNIX-Type Functions</a>)<br>
<br>
</li>
<li><a href="ipcsemun.htm">sem_unlink()</a>--Unlink Named Semaphore<br>
<br>
</li>
<li><a href="ipcsemou.htm">QlgSem_open()</a>--Open Named Semaphore (using
NLS-enabled path name)<br>
<br>
</li>
<li><a href="ipcsemonu.htm">QlgSem_open_np()</a>--Open Named Semaphore with
Maximum Value (using NLS-enabled path name)</li>
</ul>
<p><strong>Note:</strong> All of the related information for <strong>
sem_unlink()</strong> applies to <strong>QlgSem_unlink()</strong>. See Related
Information in <a href="ipcsemun.htm#risemun">sem_unlink()</a>.</p>
<br>
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<p>The following example unlinks the named semaphore "/mysem".</p>
<pre>
#include &lt;semaphore.h&gt;
#include &lt;qlg.h&gt;
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 &gt;= 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);
}
</pre>
<br>
<hr>
API introduced: V5R1
<hr>
<center><table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center></body>
</html>