⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 posix_typed_mem_get_info.html

📁 IEEE 1003.1-2003, Single Unix Specification v3
💻 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-2003 The Open Group, All Rights Reserved --><title>posix_typed_mem_get_info</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="posix_typed_mem_get_info"></a> <a name="tag_03_480"></a><!-- posix_typed_mem_get_info --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright &copy; 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_480_01"></a>NAME</h4><blockquote>posix_typed_mem_get_info - query typed memory information (<b>ADVANCED REALTIME</b>)</blockquote><h4><a name="tag_03_480_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><div class="box"><code><tt><sup>[<a href="javascript:open_code('TYM')">TYM</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> #include &lt;<a href="../basedefs/sys/mman.h.html">sys/mman.h</a>&gt;<br><br> int posix_typed_mem_get_info(int</tt> <i>fildes</i><tt>,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct posix_typed_mem_info *</tt><i>info</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_480_03"></a>DESCRIPTION</h4><blockquote><p>The <i>posix_typed_mem_get_info</i>() function shall return, in the <i>posix_tmi_length</i> field of the<b>posix_typed_mem_info</b> structure pointed to by <i>info</i>, the maximum length which may be successfully allocated by thetyped memory object designated by <i>fildes</i>. This maximum length shall take into account the flag POSIX_TYPED_MEM_ALLOCATE orPOSIX_TYPED_MEM_ALLOCATE_CONTIG specified when the typed memory object represented by <i>fildes</i> was opened. The maximum lengthis dynamic; therefore, the value returned is valid only while the current mapping of the corresponding typed memory pool remainsunchanged.</p><p>If <i>fildes</i> represents a typed memory object opened with neither the POSIX_TYPED_MEM_ALLOCATE flag nor thePOSIX_TYPED_MEM_ALLOCATE_CONTIG flag specified, the returned value of <i>info</i>-&gt;<i>posix_tmi_length</i> is unspecified.</p><p>The <i>posix_typed_mem_get_info</i>() function may return additional implementation-defined information in other fields of the<b>posix_typed_mem_info</b> structure pointed to by <i>info</i>.</p><p>If the memory object specified by <i>fildes</i> is not a typed memory object, then the behavior of this function isundefined.</p></blockquote><h4><a name="tag_03_480_04"></a>RETURN VALUE</h4><blockquote><p>Upon successful completion, the <i>posix_typed_mem_get_info</i>() function shall return zero; otherwise, the corresponding errorstatus value shall be returned.</p></blockquote><h4><a name="tag_03_480_05"></a>ERRORS</h4><blockquote><p>The <i>posix_typed_mem_get_info</i>() function shall fail if:</p><dl compact><dt>[EBADF]</dt><dd>The <i>fildes</i> argument is not a valid open file descriptor.</dd><dt>[ENODEV]</dt><dd>The <i>fildes</i> argument is not connected to a memory object supported by this function.</dd></dl><p>This function shall not return an error code of [EINTR].</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_480_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_480_07"></a>APPLICATION USAGE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_480_08"></a>RATIONALE</h4><blockquote><p>An application that needs to allocate a block of typed memory with length dependent upon the amount of memory currentlyavailable must either query the typed memory object to obtain the amount available, or repeatedly invoke <a href="../functions/mmap.html"><i>mmap</i>()</a> attempting to guess an appropriate length. While the latter method is existing practicewith <a href="../functions/malloc.html"><i>malloc</i>()</a>, it is awkward and imprecise. The <i>posix_typed_mem_get_info</i>()function allows an application to immediately determine available memory. This is particularly important for typed memory objectsthat may in some cases be scarce resources. Note that when a typed memory pool is a shared resource, some form of mutual-exclusionor synchronization may be required while typed memory is being queried and allocated to prevent race conditions.</p><p>The existing <a href="../functions/fstat.html"><i>fstat</i>()</a> function is not suitable for this purpose. We realize thatimplementations may wish to provide other attributes of typed memory objects (for example, alignment requirements, page size, andso on). The <a href="../functions/fstat.html"><i>fstat</i>()</a> function returns a structure which is not extensible and,furthermore, contains substantial information that is inappropriate for typed memory objects.</p></blockquote><h4><a name="tag_03_480_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_480_10"></a>SEE ALSO</h4><blockquote><p><a href="fstat.html"><i>fstat</i>()</a> , <a href="mmap.html"><i>mmap</i>()</a> , <a href="posix_typed_mem_open.html"><i>posix_typed_mem_open</i>()</a> , the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <ahref="../basedefs/sys/mman.h.html"><i>&lt;sys/mman.h&gt;</i></a></p></blockquote><h4><a name="tag_03_480_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 6. Derived from IEEE&nbsp;Std&nbsp;1003.1j-2000.</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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -