📄 nice.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>nice</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_007_892"> </a>NAME</h4><blockquote>nice - change nice value of a process</blockquote><h4><a name = "tag_000_007_893"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="unistd.h.html">unistd.h</a>>int nice(int <i>incr</i>);</code></pre></blockquote><h4><a name = "tag_000_007_894"> </a>DESCRIPTION</h4><blockquote>The<i>nice()</i>function adds the value of<i>incr</i>to the nice value of the calling process. A process' nice value is anon-negative number for which a more positive value results inless favourable scheduling.<p>A maximum nice value of 2 * {NZERO} -1 and a minimum nice value of 0are imposed by the system.Requests for values above or below these limits result in the nice valuebeing set to the corresponding limit. Only a process with appropriateprivileges can lower the nice value.<p>Calling the<i>nice()</i>function has no effect on the priority of processes or threadswith policy SCHED_FIFO or SCHED_RR.The effect on processes or threads with other scheduling policies isimplementation-dependent.<p>The nice value set with<i>nice()</i>is applied to the process.If the process is multi-threaded, the nice value affects allsystem scope threads in the process.</blockquote><h4><a name = "tag_000_007_895"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>nice()</i>returns the new nice value minus {NZERO}.Otherwise, -1 is returned,the process' nice value is not changed, and<i>errno</i>is set to indicate the error.</blockquote><h4><a name = "tag_000_007_896"> </a>ERRORS</h4><blockquote>The<i>nice()</i>function will fail if:<dl compact><dt>[EPERM]<dd>The<i>incr</i>argument is negative and thecalling process does not have appropriate privileges.</dl></blockquote><h4><a name = "tag_000_007_897"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_898"> </a>APPLICATION USAGE</h4><blockquote>As -1 is apermissible return value in a successful situation, an applicationwishing to check for error situations should set<i>errno</i>to 0, then call<i>nice()</i>,and if it returns -1, check to see if<i>errno</i>is non-zero.</blockquote><h4><a name = "tag_000_007_899"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_900"> </a>SEE ALSO</h4><blockquote><i><a href="limits.h.html"><limits.h></a></i>,<i><a href="unistd.h.html"><unistd.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 + -