📄 ulimit.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>ulimit</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="ulimit"></a> <a name="tag_03_797"></a><!-- ulimit --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_797_01"></a>NAME</h4><blockquote>ulimit - get and set process limits</blockquote><h4><a name="tag_03_797_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 <<a href="../basedefs/ulimit.h.html">ulimit.h</a>><br><br> long ulimit(int</tt> <i>cmd</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_797_03"></a>DESCRIPTION</h4><blockquote><p>The <i>ulimit</i>() function shall control process limits. The process limits that can be controlled by this function includethe maximum size of a single file that can be written (this is equivalent to using <a href="../functions/setrlimit.html"><i>setrlimit</i>()</a> with RLIMIT_FSIZE). The <i>cmd</i> values, defined in <a href="../basedefs/ulimit.h.html"><i><ulimit.h></i></a>, include:</p><dl compact><dt>UL_GETFSIZE</dt><dd>Return the file size limit (RLIMIT_FSIZE) of the process. The limit shall be in units of 512-byte blocks and shall be inheritedby child processes. Files of any size can be read. The return value shall be the integer part of the soft file size limit dividedby 512. If the result cannot be represented as a <b>long</b>, the result is unspecified.</dd><dt>UL_SETFSIZE</dt><dd>Set the file size limit for output operations of the process to the value of the second argument, taken as a <b>long</b>,multiplied by 512. If the result would overflow an <b>rlim_t</b>, the actual value set is unspecified. Any process may decrease itsown limit, but only a process with appropriate privileges may increase the limit. The return value shall be the integer part of thenew file size limit divided by 512.</dd></dl><p>The <i>ulimit</i>() function shall not change the setting of <i>errno</i> if successful.</p><p>As all return values are permissible in a successful situation, an application wishing to check for error situations should set<i>errno</i> to 0, then call <i>ulimit</i>(), and, if it returns -1, check to see if <i>errno</i> is non-zero.</p></blockquote><h4><a name="tag_03_797_04"></a>RETURN VALUE</h4><blockquote><p>Upon successful completion, <i>ulimit</i>() shall return the value of the requested limit. Otherwise, -1 shall be returned and<i>errno</i> set to indicate the error.</p></blockquote><h4><a name="tag_03_797_05"></a>ERRORS</h4><blockquote><p>The <i>ulimit</i>() function shall fail and the limit shall be unchanged if:</p><dl compact><dt>[EINVAL]</dt><dd>The <i>cmd</i> argument is not valid.</dd><dt>[EPERM]</dt><dd>A process not having appropriate privileges attempts to increase its file size limit.</dd></dl></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_797_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_797_07"></a>APPLICATION USAGE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_797_08"></a>RATIONALE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_797_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_797_10"></a>SEE ALSO</h4><blockquote><p><a href="getrlimit.html"><i>getrlimit</i>()</a> , <a href="setrlimit.html"><i>setrlimit</i>()</a> , <a href="write.html"><i>write</i>()</a> , the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/ulimit.h.html"><i><ulimit.h></i></a></p></blockquote><h4><a name="tag_03_797_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 1. Derived from Issue 1 of the SVID.</p></blockquote><h4><a name="tag_03_797_12"></a>Issue 5</h4><blockquote><p>In the description of UL_SETFSIZE, the text is corrected to refer to <b>rlim_t</b> rather than the spurious <b>rlimit_t</b>.</p><p>The DESCRIPTION is updated to indicate that <i>errno</i> is not changed if the function is successful.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® 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 + -