Files
2024-02-19 00:21:47 -05:00

143 lines
5.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>shmdt</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="shmdt"></a> <a name="tag_03_677"></a><!-- shmdt -->
<!--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_03_677_01"></a>NAME</h4>
<blockquote>shmdt - XSI shared memory detach operation</blockquote>
<h4><a name="tag_03_677_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt=
"[Option Start]" border="0"> #include &lt;<a href="../basedefs/sys/shm.h.html">sys/shm.h</a>&gt;<br>
<br>
int shmdt(const void *</tt><i>shmaddr</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
<tt><br>
</tt></blockquote>
<h4><a name="tag_03_677_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>shmdt</i>() function operates on XSI shared memory (see the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a
href="../basedefs/xbd_chap03.html#tag_03_340">Section 3.340, Shared Memory Object</a>). It is unspecified whether this function
interoperates with the realtime interprocess communication facilities defined in <a href=
"xsh_chap02_08.html#tag_02_08"><i>Realtime</i></a> .</p>
<p>The <i>shmdt</i>() function detaches the shared memory segment located at the address specified by <i>shmaddr</i> from the
address space of the calling process.</p>
</blockquote>
<h4><a name="tag_03_677_04"></a>RETURN VALUE</h4>
<blockquote>
<p>Upon successful completion, <i>shmdt</i>() shall decrement the value of <i>shm_nattch</i> in the data structure associated with
the shared memory ID of the attached shared memory segment and return 0.</p>
<p>Otherwise, the shared memory segment shall not be detached, <i>shmdt</i>() shall return -1, and <i>errno</i> shall be set to
indicate the error.</p>
</blockquote>
<h4><a name="tag_03_677_05"></a>ERRORS</h4>
<blockquote>
<p>The <i>shmdt</i>() function shall fail if:</p>
<dl compact>
<dt>[EINVAL]</dt>
<dd>The value of <i>shmaddr</i> is not the data segment start address of a shared memory segment.</dd>
</dl>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_03_677_06"></a>EXAMPLES</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_677_07"></a>APPLICATION USAGE</h4>
<blockquote>
<p>The POSIX Realtime Extension defines alternative interfaces for interprocess communication. Application developers who need to
use IPC should design their applications so that modules using the IPC routines described in <a href=
"xsh_chap02_07.html#tag_02_07"><i>XSI Interprocess Communication</i></a> can be easily modified to use the alternative
interfaces.</p>
</blockquote>
<h4><a name="tag_03_677_08"></a>RATIONALE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_677_09"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_677_10"></a>SEE ALSO</h4>
<blockquote>
<p><a href="xsh_chap02_07.html#tag_02_07"><i>XSI Interprocess Communication</i></a> , <a href=
"xsh_chap02_08.html#tag_02_08"><i>Realtime</i></a> , <a href="exec.html"><i><a href="../functions/exec.html">exec</a></i>()</a> ,
<a href="exit.html"><i>exit</i>()</a> , <a href="fork.html"><i>fork</i>()</a> , <a href="shmat.html"><i>shmat</i>()</a> , <a href=
"shmctl.html"><i>shmctl</i>()</a> , <a href="shmget.html"><i>shmget</i>()</a> , <a href="shm_open.html"><i>shm_open</i>()</a> , <a
href="shm_unlink.html"><i>shm_unlink</i>()</a> , the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href=
"../basedefs/sys/shm.h.html"><i>&lt;sys/shm.h&gt;</i></a></p>
</blockquote>
<h4><a name="tag_03_677_11"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 2. Derived from Issue 2 of the SVID.</p>
</blockquote>
<h4><a name="tag_03_677_12"></a>Issue 5</h4>
<blockquote>
<p>Moved from SHARED MEMORY to BASE.</p>
<p>The note about use of POSIX Realtime Extension IPC routines has been moved from FUTURE DIRECTIONS to a new APPLICATION USAGE
section.</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>