Files
oldlinux-files/study/Ref-docs/POSIX/susv3/basedefs/sys/ipc.h.html
2024-02-19 00:25:23 -05:00

155 lines
4.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
<title>&lt;sys/ipc.h&gt;</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../../jscript/dotcode.js">
</script>
<basefont size="3"> <a name="&lt;sys/ipc.h&gt;"></a> <a name="tag_13_54"></a><!-- &lt;sys/ipc.h&gt; -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_13_54_01"></a>NAME</h4>
<blockquote>sys/ipc.h - XSI interprocess communication access structure</blockquote>
<h4><a name="tag_13_54_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<div class="box"><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../../images/opt-start.gif" alt=
"[Option Start]" border="0"> #include &lt;sys/ipc.h&gt; <img src="../../images/opt-end.gif" alt="[Option End]" border=
"0"></tt></div>
</blockquote>
<h4><a name="tag_13_54_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>&lt;sys/ipc.h&gt;</i> header is used by three mechanisms for XSI interprocess communication (IPC): messages, semaphores,
and shared memory. All use a common structure type, <b>ipc_perm</b>, to pass information used in determining permission to perform
an IPC operation.</p>
<p>The <b>ipc_perm</b> structure shall contain the following members:</p>
<pre>
<tt>uid_t uid </tt> Owner's user ID. <tt>
gid_t gid </tt> Owner's group ID. <tt>
uid_t cuid </tt> Creator's user ID. <tt>
gid_t cgid </tt> Creator's group ID. <tt>
mode_t mode </tt> Read/write permission. <tt>
</tt>
</pre>
<p>The <b>uid_t</b>, <b>gid_t</b>, <b>mode_t</b>, and <b>key_t</b> types shall be defined as described in <a href=
"../sys/types.h.html#tag_13_67"><i>&lt;sys/types.h&gt;</i></a> .</p>
<p>Definitions shall be provided for the following constants:</p>
<p>Mode bits:</p>
<dl compact>
<dt>IPC_CREAT</dt>
<dd>Create entry if key does not exist.</dd>
<dt>IPC_EXCL</dt>
<dd>Fail if key exists.</dd>
<dt>IPC_NOWAIT</dt>
<dd>Error if request must wait.</dd>
</dl>
<p>Keys:</p>
<dl compact>
<dt>IPC_PRIVATE</dt>
<dd>Private key.</dd>
</dl>
<p>Control commands:</p>
<dl compact>
<dt>IPC_RMID</dt>
<dd>Remove identifier.</dd>
<dt>IPC_SET</dt>
<dd>Set options.</dd>
<dt>IPC_STAT</dt>
<dd>Get options.</dd>
</dl>
<p>The following shall be declared as a function and may also be defined as a macro. A function prototype shall be provided.</p>
<pre>
<tt>key_t ftok(const char *, int);
</tt>
</pre>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_13_54_04"></a>APPLICATION USAGE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_54_05"></a>RATIONALE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_54_06"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_54_07"></a>SEE ALSO</h4>
<blockquote>
<p><a href="../sys/types.h.html#tag_13_67"><i>&lt;sys/types.h&gt;</i></a> , the System Interfaces volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../../functions/ftok.html"><i>ftok</i>()</a></p>
</blockquote>
<h4><a name="tag_13_54_08"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 2. Derived from System V Release 2.0.</p>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; is a registered Trademark of The IEEE.<br>
[ <a href="../../mindex.html">Main Index</a> | <a href="../../basedefs/contents.html">XBD</a> | <a href=
"../../utilities/contents.html">XCU</a> | <a href="../../functions/contents.html">XSH</a> | <a href=
"../../xrat/contents.html">XRAT</a> ]</font></center>
<!--footer end-->
<hr size="2" noshade>
</body>
</html>