Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
nice.html (15749B)
1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved --> 2 <!DOCTYPE HTML> 3 <html lang="en"> 4 <head> 5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0"> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 --> 8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved --> 9 <title>nice</title> 10 </head> 11 <body bgcolor="white"> 12 <div class="NAVHEADER"> 13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 14 <tr class="nav"> 15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/ngettext.html" accesskey="P"><<< 16 Previous</a></td> 17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/nl.html" accesskey="N">Next >>></a></td> 19 </tr> 20 </table> 21 <hr align="left" width="100%"></div> 22 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> 23 <center><font size="2">The Open Group Base Specifications Issue 8<br> 24 IEEE Std 1003.1-2024<br> 25 Copyright © 2001-2024 The IEEE and The Open Group</font></center> 26 <hr size="2" noshade> 27 <a name="top" id="top"></a> <a name="nice" id="nice"></a> <a name="tag_20_86" id="tag_20_86"></a><!-- nice --> 28 <h4 class="mansect"><a name="tag_20_86_01" id="tag_20_86_01"></a>NAME</h4> 29 <blockquote>nice — invoke a utility with an altered nice value</blockquote> 30 <h4 class="mansect"><a name="tag_20_86_02" id="tag_20_86_02"></a>SYNOPSIS</h4> 31 <blockquote class="synopsis"> 32 <p><code><tt>nice</tt> <b>[</b><tt>-n</tt> <i>increment</i><b>]</b> <i>utility</i> <b>[</b><i>argument</i><tt>...</tt><b>]</b></code></p> 33 </blockquote> 34 <h4 class="mansect"><a name="tag_20_86_03" id="tag_20_86_03"></a>DESCRIPTION</h4> 35 <blockquote> 36 <p>The <i>nice</i> utility shall invoke a utility, requesting that it be run with a different nice value (see XBD <a href= 37 "../basedefs/V1_chap03.html#tag_03_225"><i>3.225 Nice Value</i></a> ). With no options, the executed utility shall be run with a 38 nice value that is some implementation-defined quantity greater than or equal to the nice value of the current process. If the user 39 lacks appropriate privileges to affect the nice value in the requested manner, the <i>nice</i> utility shall not affect the nice 40 value; in this case, a warning message may be written to standard error, but this shall not prevent the invocation of 41 <i>utility</i> or affect the exit status.</p> 42 </blockquote> 43 <h4 class="mansect"><a name="tag_20_86_04" id="tag_20_86_04"></a>OPTIONS</h4> 44 <blockquote> 45 <p>The <i>nice</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 46 Guidelines</i></a> .</p> 47 <p>The following option is supported:</p> 48 <dl compact> 49 <dd></dd> 50 <dt><b>-n </b><i>increment</i></dt> 51 <dd>A positive or negative decimal integer which shall have the same effect on the execution of the utility as if the utility had 52 called the <a href="../functions/nice.html"><i>nice</i>()</a> function with the numeric value of the <i>increment</i> 53 option-argument.</dd> 54 </dl> 55 </blockquote> 56 <h4 class="mansect"><a name="tag_20_86_05" id="tag_20_86_05"></a>OPERANDS</h4> 57 <blockquote> 58 <p>The following operands shall be supported:</p> 59 <dl compact> 60 <dd></dd> 61 <dt><i>utility</i></dt> 62 <dd>The name of a utility that is to be invoked. If the <i>utility</i> operand names any of the special built-in utilities in 63 <a href="../utilities/V3_chap02.html#tag_19_15"><i>2.15 Special Built-In Utilities</i></a> , the results are undefined.</dd> 64 <dt><i>argument</i></dt> 65 <dd>Any string to be supplied as an argument when invoking the utility named by the <i>utility</i> operand.</dd> 66 </dl> 67 </blockquote> 68 <h4 class="mansect"><a name="tag_20_86_06" id="tag_20_86_06"></a>STDIN</h4> 69 <blockquote> 70 <p>Not used.</p> 71 </blockquote> 72 <h4 class="mansect"><a name="tag_20_86_07" id="tag_20_86_07"></a>INPUT FILES</h4> 73 <blockquote> 74 <p>None.</p> 75 </blockquote> 76 <h4 class="mansect"><a name="tag_20_86_08" id="tag_20_86_08"></a>ENVIRONMENT VARIABLES</h4> 77 <blockquote> 78 <p>The following environment variables shall affect the execution of <i>nice</i>:</p> 79 <dl compact> 80 <dd></dd> 81 <dt><i>LANG</i></dt> 82 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 83 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 84 variables used to determine the values of locale categories.)</dd> 85 <dt><i>LC_ALL</i></dt> 86 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 87 <dt><i>LC_CTYPE</i></dt> 88 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 89 opposed to multi-byte characters in arguments).</dd> 90 <dt><i>LC_MESSAGES</i></dt> 91 <dd><br> 92 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd> 93 <dt><i>NLSPATH</i></dt> 94 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 95 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 96 "0"></dd> 97 <dt><i>PATH</i></dt> 98 <dd>Determine the search path used to locate the utility to be invoked. See XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. 99 Environment Variables</i></a> .</dd> 100 </dl> 101 </blockquote> 102 <h4 class="mansect"><a name="tag_20_86_09" id="tag_20_86_09"></a>ASYNCHRONOUS EVENTS</h4> 103 <blockquote> 104 <p>Default.</p> 105 </blockquote> 106 <h4 class="mansect"><a name="tag_20_86_10" id="tag_20_86_10"></a>STDOUT</h4> 107 <blockquote> 108 <p>Not used.</p> 109 </blockquote> 110 <h4 class="mansect"><a name="tag_20_86_11" id="tag_20_86_11"></a>STDERR</h4> 111 <blockquote> 112 <p>The standard error shall be used only for diagnostic messages.</p> 113 </blockquote> 114 <h4 class="mansect"><a name="tag_20_86_12" id="tag_20_86_12"></a>OUTPUT FILES</h4> 115 <blockquote> 116 <p>None.</p> 117 </blockquote> 118 <h4 class="mansect"><a name="tag_20_86_13" id="tag_20_86_13"></a>EXTENDED DESCRIPTION</h4> 119 <blockquote> 120 <p>None.</p> 121 </blockquote> 122 <h4 class="mansect"><a name="tag_20_86_14" id="tag_20_86_14"></a>EXIT STATUS</h4> 123 <blockquote> 124 <p>If <i>utility</i> is invoked, the exit status of <i>nice</i> shall be the exit status of <i>utility</i>; otherwise, the 125 <i>nice</i> utility shall exit with one of the following values:</p> 126 <dl compact> 127 <dd></dd> 128 <dt>1-125</dt> 129 <dd>An error occurred in the <i>nice</i> utility.</dd> 130 <dt> 126</dt> 131 <dd>The utility specified by <i>utility</i> was found but could not be invoked.</dd> 132 <dt> 127</dt> 133 <dd>The utility specified by <i>utility</i> could not be found.</dd> 134 </dl> 135 </blockquote> 136 <h4 class="mansect"><a name="tag_20_86_15" id="tag_20_86_15"></a>CONSEQUENCES OF ERRORS</h4> 137 <blockquote> 138 <p>Default.</p> 139 </blockquote> 140 <hr> 141 <div class="box"><em>The following sections are informative.</em></div> 142 <h4 class="mansect"><a name="tag_20_86_16" id="tag_20_86_16"></a>APPLICATION USAGE</h4> 143 <blockquote> 144 <p>The only guaranteed portable uses of this utility are:</p> 145 <dl compact> 146 <dd></dd> 147 <dt><i>nice utility</i></dt> 148 <dd><br> 149 Run <i>utility</i> with the default higher or equal nice value.</dd> 150 <dt><i>nice </i><b>-n </b><<i>positive integer</i>><i> utility</i></dt> 151 <dd><br> 152 Run <i>utility</i> with a higher nice value.</dd> 153 </dl> 154 <p>On some implementations they have no discernible effect on the invoked utility and on some others they are exactly 155 equivalent.</p> 156 <p>Historical systems have frequently supported the <<i>positive integer</i>> up to 20. Since there is no error penalty 157 associated with guessing a number that is too high, users without access to the system conformance document (to see what limits are 158 actually in place) could use the historical 1 to 20 range or attempt to use very large numbers if the job should be truly low 159 priority.</p> 160 <p>The nice value of a process can be displayed using the command:</p> 161 <pre> 162 <tt>ps -o nice 163 </tt></pre> 164 <p>The <a href="../utilities/command.html"><i>command</i></a>, <a href="../utilities/env.html"><i>env</i></a>, <i>nice</i>, 165 <a href="../utilities/nohup.html"><i>nohup</i></a>, <a href="../utilities/time.html"><i>time</i></a>, <a href= 166 "../utilities/timeout.html"><i>timeout</i></a>, and <a href="../utilities/xargs.html"><i>xargs</i></a> utilities have been 167 specified to use exit code 127 if a utility to be invoked cannot be found, so that applications can distinguish "failure to find a 168 utility" from "invoked utility exited with an error indication". The value 127 was chosen because it is not commonly used for 169 other meanings; most utilities use small values for "normal error conditions" and the values above 128 can be confused with 170 termination due to receipt of a signal. The value 126 was chosen in a similar manner to indicate that the utility could be found, 171 but not invoked. Some scripts produce meaningful error messages differentiating the 126 and 127 cases. The distinction between exit 172 codes 126 and 127 is based on KornShell practice that uses 127 when all attempts to <i>exec</i> the utility fail with [ENOENT], and 173 uses 126 when any attempt to <i>exec</i> the utility fails for any other reason.</p> 174 </blockquote> 175 <h4 class="mansect"><a name="tag_20_86_17" id="tag_20_86_17"></a>EXAMPLES</h4> 176 <blockquote> 177 <p>None.</p> 178 </blockquote> 179 <h4 class="mansect"><a name="tag_20_86_18" id="tag_20_86_18"></a>RATIONALE</h4> 180 <blockquote> 181 <p>The 4.3 BSD version of <i>nice</i> does not check whether <i>increment</i> is a valid decimal integer. The command <i>nice</i> 182 <b>-x</b> <i>utility</i>, for example, would be treated the same as the command <i>nice</i> <b>--1</b> <i>utility</i>. If the user 183 does not have appropriate privileges, this results in a "permission denied" error. This is considered a bug.</p> 184 <p>When a user without appropriate privileges gives a negative <i>increment</i>, System V treats it like the command <i>nice</i> 185 <b>-0</b> <i>utility</i>, while 4.3 BSD writes a "permission denied" message and does not run the utility. The standard specifies 186 the System V behavior together with an optional BSD-style "permission denied" message.</p> 187 <p>The C shell has a built-in version of <i>nice</i> that has a different interface from the one described in this volume of 188 POSIX.1-2024.</p> 189 <p>The term "utility" is used, rather than "command", to highlight the fact that shell compound commands, pipelines, and so on, 190 cannot be used. Special built-ins also cannot be used. However, "utility" includes user application programs and shell scripts, 191 not just utilities defined in this volume of POSIX.1-2024.</p> 192 <p>Historical implementations of <i>nice</i> provide a nice value range of 40 or 41 discrete steps, with the default nice value 193 being the midpoint of that range. By default, they raise the nice value of the executed utility by 10.</p> 194 <p>Some historical documentation states that the <i>increment</i> value must be within a fixed range. This is misleading; the valid 195 <i>increment</i> values on any invocation are determined by the current process nice value, which is not always the default.</p> 196 <p>The definition of nice value is not intended to suggest that all processes in a system have priorities that are comparable. 197 Scheduling policy extensions such as the realtime priorities in the System Interfaces volume of POSIX.1-2024 make the notion of a 198 single underlying priority for all scheduling policies problematic. Some implementations may implement the <i>nice</i>-related 199 features to affect all processes on the system, others to affect just the general time-sharing activities implied by this volume of 200 POSIX.1-2024, and others may have no effect at all. Because of the use of "implementation-defined" in <i>nice</i> and <a href= 201 "../utilities/renice.html"><i>renice</i></a>, a wide range of implementation strategies are possible.</p> 202 <p>Earlier versions of this standard allowed a <b>-</b><i>increment</i> option. This form is no longer specified by POSIX.1-2024 203 but may be present in some implementations.</p> 204 </blockquote> 205 <h4 class="mansect"><a name="tag_20_86_19" id="tag_20_86_19"></a>FUTURE DIRECTIONS</h4> 206 <blockquote> 207 <p>None.</p> 208 </blockquote> 209 <h4 class="mansect"><a name="tag_20_86_20" id="tag_20_86_20"></a>SEE ALSO</h4> 210 <blockquote> 211 <p><a href="../utilities/V3_chap02.html#tag_19"><i>2. Shell Command Language</i></a> , <a href= 212 "../utilities/renice.html#"><i>renice</i></a></p> 213 <p>XBD <a href="../basedefs/V1_chap03.html#tag_03_225"><i>3.225 Nice Value</i></a> , <a href= 214 "../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 215 Utility Syntax Guidelines</i></a></p> 216 <p>XSH <a href="../functions/nice.html#tag_17_370"><i>nice</i></a></p> 217 </blockquote> 218 <h4 class="mansect"><a name="tag_20_86_21" id="tag_20_86_21"></a>CHANGE HISTORY</h4> 219 <blockquote> 220 <p>First released in Issue 4.</p> 221 </blockquote> 222 <h4 class="mansect"><a name="tag_20_86_22" id="tag_20_86_22"></a>Issue 6</h4> 223 <blockquote> 224 <p>This utility is marked as part of the User Portability Utilities option.</p> 225 <p>The obsolescent SYNOPSIS is removed.</p> 226 <p>IEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/18 is applied, deleting a paragraph of RATIONALE that referred 227 to text no longer in the standard.</p> 228 </blockquote> 229 <h4 class="mansect"><a name="tag_20_86_23" id="tag_20_86_23"></a>Issue 7</h4> 230 <blockquote> 231 <p>Austin Group Interpretation 1003.1-2001 #027 is applied.</p> 232 <p>SD5-XCU-ERN-32 and SD5-XCU-ERN-33 are applied, updating the DESCRIPTION, APPLICATION USAGE, and RATIONALE sections.</p> 233 <p>The <i>nice</i> utility is moved from the User Portability Utilities option to the Base. User Portability Utilities is now an 234 option for interactive utilities.</p> 235 </blockquote> 236 <h4 class="mansect"><a name="tag_20_86_24" id="tag_20_86_24"></a>Issue 8</h4> 237 <blockquote> 238 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 239 <p>Austin Group Defect 1586 is applied, adding the <a href="../utilities/timeout.html"><i>timeout</i></a> utility.</p> 240 <p>Austin Group Defect 1594 is applied, changing the APPLICATION USAGE section.</p> 241 </blockquote> 242 <div class="box"><em>End of informative text.</em></div> 243 <hr> 244 <p> </p> 245 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 246 <hr size="2" noshade> 247 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 248 POSIX™ is a Trademark of The IEEE.<br> 249 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 250 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 251 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 252 ]</font></center> 253 <hr size="2" noshade> 254 <div class="NAVHEADER"> 255 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 256 <tr class="nav"> 257 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/ngettext.html" accesskey="P"><<< 258 Previous</a></td> 259 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 260 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/nl.html" accesskey="N">Next >>></a></td> 261 </tr> 262 </table> 263 <hr align="left" width="100%"></div> 264 </body> 265 </html>