📄 ulimit.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>ulimit</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_010_229"> </a>NAME</h4><blockquote>ulimit - get and set process limits</blockquote><h4><a name = "tag_000_010_230"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="ulimit.h.html">ulimit.h</a>>long int ulimit(int <i>cmd</i>, ...);</code></pre></blockquote><h4><a name = "tag_000_010_231"> </a>DESCRIPTION</h4><blockquote>The<i>ulimit()</i>function provides for control over process limits. The<i>cmd</i>values, defined in<i><a href="ulimit.h.html"><ulimit.h></a></i>include:<dl compact><dt>UL_GETFSIZE<dd>Return the soft file size limit of the process.The limit is in units of 512-byte blocksand is inherited by child processes.Files of any size can be read.The return value is the integer part of the soft file size limit divided by512. If the result cannot be represented as a<b>long int</b>,the result is unspecified.<dt>UL_SETFSIZE<dd>Set the hard and soft file size limits for output operations of theprocess to the value of the second argument, taken as a<b>long int</b>.Any process may decrease its own hard limit, but only a process withappropriate privileges may increase the limit.The new file size limit is returned.The hard and soft file size limits are set to the specified value multipliedby 512. If the result would overflow an<b>rlim_t</b>,the actual value set is unspecified.</dl><p>The<i>ulimit()</i>function will not change the setting of <b>errno</b>if successful.</blockquote><h4><a name = "tag_000_010_232"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>ulimit()</i>returns the value of the requested limit. Otherwise -1 is returned and<i>errno</i>is set to indicate the error.</blockquote><h4><a name = "tag_000_010_233"> </a>ERRORS</h4><blockquote>The<i>ulimit()</i>function will fail and the limit will be unchanged if:<dl compact><dt>[EINVAL]<dd>The<i>cmd</i>argument is not valid.<dt>[EPERM]<dd>A process not having appropriate privileges attempts to increase itsfile size limit.</dl></blockquote><h4><a name = "tag_000_010_234"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_235"> </a>APPLICATION USAGE</h4><blockquote>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.</blockquote><h4><a name = "tag_000_010_236"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_237"> </a>SEE ALSO</h4><blockquote><i><a href="getrlimit.html">getrlimit()</a></i>,<i><a href="setrlimit.html">setrlimit()</a></i>,<i><a href="write.html">write()</a></i>,<i><a href="ulimit.h.html"><ulimit.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -