logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

nice.1p (9600B)


  1. '\" et
  2. .TH NICE "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. nice
  12. \(em invoke a utility with an altered nice value
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. nice \fB[\fR-n \fIincrement\fB] \fIutility \fB[\fIargument\fR...\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR nice
  21. utility shall invoke a utility, requesting that it be run with a
  22. different nice value (see the Base Definitions volume of POSIX.1\(hy2017,
  23. .IR "Section 3.244" ", " "Nice Value").
  24. With no options, the executed utility shall be run with a nice value
  25. that is some implementation-defined quantity greater than or equal to
  26. the nice value of the current process. If the user lacks appropriate
  27. privileges to affect the nice value in the requested manner, the
  28. .IR nice
  29. utility shall not affect the nice value; in this case, a warning
  30. message may be written to standard error, but this shall not prevent
  31. the invocation of
  32. .IR utility
  33. or affect the exit status.
  34. .SH OPTIONS
  35. The
  36. .IR nice
  37. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  38. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  39. .P
  40. The following option is supported:
  41. .IP "\fB\-n\ \fIincrement\fR" 10
  42. A positive or negative decimal integer which shall have the same
  43. effect on the execution of the utility as if the utility had
  44. called the
  45. \fInice\fR()
  46. function with the numeric value of the
  47. .IR increment
  48. option-argument.
  49. .SH OPERANDS
  50. The following operands shall be supported:
  51. .IP "\fIutility\fR" 10
  52. The name of a utility that is to be invoked. If the
  53. .IR utility
  54. operand names any of the special built-in utilities in
  55. .IR "Section 2.14" ", " "Special Built-In Utilities",
  56. the results are undefined.
  57. .IP "\fIargument\fR" 10
  58. Any string to be supplied as an argument when invoking the utility
  59. named by the
  60. .IR utility
  61. operand.
  62. .SH STDIN
  63. Not used.
  64. .SH "INPUT FILES"
  65. None.
  66. .SH "ENVIRONMENT VARIABLES"
  67. The following environment variables shall affect the execution of
  68. .IR nice :
  69. .IP "\fILANG\fP" 10
  70. Provide a default value for the internationalization variables that are
  71. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  72. .IR "Section 8.2" ", " "Internationalization Variables"
  73. for the precedence of internationalization variables used to determine
  74. the values of locale categories.)
  75. .IP "\fILC_ALL\fP" 10
  76. If set to a non-empty string value, override the values of all the
  77. other internationalization variables.
  78. .IP "\fILC_CTYPE\fP" 10
  79. Determine the locale for the interpretation of sequences of bytes of
  80. text data as characters (for example, single-byte as opposed to
  81. multi-byte characters in arguments).
  82. .IP "\fILC_MESSAGES\fP" 10
  83. .br
  84. Determine the locale that should be used to affect the format and
  85. contents of diagnostic messages written to standard error.
  86. .IP "\fINLSPATH\fP" 10
  87. Determine the location of message catalogs for the processing of
  88. .IR LC_MESSAGES .
  89. .IP "\fIPATH\fP" 10
  90. Determine the search path used to locate the utility to be invoked.
  91. See the Base Definitions volume of POSIX.1\(hy2017,
  92. .IR "Chapter 8" ", " "Environment Variables".
  93. .SH "ASYNCHRONOUS EVENTS"
  94. Default.
  95. .SH STDOUT
  96. Not used.
  97. .SH STDERR
  98. The standard error shall be used only for diagnostic messages.
  99. .SH "OUTPUT FILES"
  100. None.
  101. .SH "EXTENDED DESCRIPTION"
  102. None.
  103. .SH "EXIT STATUS"
  104. If
  105. .IR utility
  106. is invoked, the exit status of
  107. .IR nice
  108. shall be the exit status of
  109. .IR utility ;
  110. otherwise, the
  111. .IR nice
  112. utility shall exit with one of the following values:
  113. .IP "1\(hy125" 8
  114. An error occurred in the
  115. .IR nice
  116. utility.
  117. .IP "\0\0126" 8
  118. The utility specified by
  119. .IR utility
  120. was found but could not be invoked.
  121. .IP "\0\0127" 8
  122. The utility specified by
  123. .IR utility
  124. could not be found.
  125. .SH "CONSEQUENCES OF ERRORS"
  126. Default.
  127. .LP
  128. .IR "The following sections are informative."
  129. .SH "APPLICATION USAGE"
  130. The only guaranteed portable uses of this utility are:
  131. .IP "\fInice\ utility\fR" 6
  132. .br
  133. Run
  134. .IR utility
  135. with the default higher or equal nice value.
  136. .IP "\fInice\ \fB\-n\ \fR<\fIpositive\ integer\fR>\fI\ utility\fR" 6
  137. .br
  138. Run
  139. .IR utility
  140. with a higher nice value.
  141. .P
  142. On some implementations they have no discernible effect on the invoked
  143. utility and on some others they are exactly equivalent.
  144. .P
  145. Historical systems have frequently supported the <\fIpositive
  146. integer\fP> up to 20. Since there is no error penalty associated with
  147. guessing a number that is too high, users without access to the system
  148. conformance document (to see what limits are actually in place) could
  149. use the historical 1 to 20 range or attempt to use very large numbers
  150. if the job should be truly low priority.
  151. .P
  152. The nice value of a process can be displayed using the command:
  153. .sp
  154. .RS 4
  155. .nf
  156. ps -o nice
  157. .fi
  158. .P
  159. .RE
  160. .P
  161. The
  162. .IR command ,
  163. .IR env ,
  164. .IR nice ,
  165. .IR nohup ,
  166. .IR time ,
  167. and
  168. .IR xargs
  169. utilities have been specified to use exit code 127 if an error occurs
  170. so that applications can distinguish ``failure to find a utility'' from
  171. ``invoked utility exited with an error indication''. The value 127 was
  172. chosen because it is not commonly used for other meanings; most
  173. utilities use small values for ``normal error conditions'' and the
  174. values above 128 can be confused with termination due to receipt of a
  175. signal. The value 126 was chosen in a similar manner to indicate that
  176. the utility could be found, but not invoked. Some scripts produce
  177. meaningful error messages differentiating the 126 and 127 cases. The
  178. distinction between exit codes 126 and 127 is based on KornShell
  179. practice that uses 127 when all attempts to
  180. .IR exec
  181. the utility fail with
  182. .BR [ENOENT] ,
  183. and uses 126 when any attempt to
  184. .IR exec
  185. the utility fails for any other reason.
  186. .SH EXAMPLES
  187. None.
  188. .SH RATIONALE
  189. The 4.3 BSD version of
  190. .IR nice
  191. does not check whether
  192. .IR increment
  193. is a valid decimal integer. The command
  194. .IR nice
  195. .BR \-x
  196. .IR utility ,
  197. for example, would be treated the same as the command
  198. .IR nice
  199. .BR \-\|\-1
  200. .IR utility .
  201. If the user does not have appropriate privileges, this results in a
  202. ``permission denied'' error.
  203. This is considered a bug.
  204. .P
  205. When a user without appropriate privileges gives a negative
  206. .IR increment ,
  207. System V treats it like the command
  208. .IR nice
  209. .BR \-0
  210. .IR utility ,
  211. while 4.3 BSD writes a ``permission denied'' message and does not run
  212. the utility. The standard specifies the System V behavior together
  213. with an optional BSD-style ``permission denied'' message.
  214. .P
  215. The C shell has a built-in version of
  216. .IR nice
  217. that has a different interface from the one described in this volume of POSIX.1\(hy2017.
  218. .P
  219. The term ``utility'' is used, rather than ``command'', to highlight the
  220. fact that shell compound commands, pipelines, and so on, cannot be
  221. used. Special built-ins also cannot be used.
  222. However, ``utility'' includes user application programs and shell
  223. scripts, not just utilities defined in this volume of POSIX.1\(hy2017.
  224. .P
  225. Historical implementations of
  226. .IR nice
  227. provide a nice value range of 40 or 41 discrete steps, with the default
  228. nice value being the midpoint of that range. By default, they raise the
  229. nice value of the executed utility by 10.
  230. .P
  231. Some historical documentation states that the
  232. .IR increment
  233. value must be within a fixed range. This is misleading; the valid
  234. .IR increment
  235. values on any invocation are determined by the current process
  236. nice value, which is not always the default.
  237. .P
  238. The definition of nice value is not intended to suggest that all
  239. processes in a system have priorities that are comparable. Scheduling
  240. policy extensions such as the realtime priorities in the System Interfaces volume of POSIX.1\(hy2017 make the
  241. notion of a single underlying priority for all scheduling policies
  242. problematic. Some implementations may implement the
  243. .IR nice -related
  244. features to affect all processes on the system, others to affect just
  245. the general time-sharing activities implied by this volume of POSIX.1\(hy2017, and others may
  246. have no effect at all. Because of the use of
  247. ``implementation-defined'' in
  248. .IR nice
  249. and
  250. .IR renice ,
  251. a wide range of implementation strategies are possible.
  252. .P
  253. Earlier versions of this standard allowed a
  254. .BR \- \c
  255. .IR increment
  256. option. This form is no longer specified by POSIX.1\(hy2008 but may
  257. be present in some implementations.
  258. .SH "FUTURE DIRECTIONS"
  259. None.
  260. .SH "SEE ALSO"
  261. .IR "Chapter 2" ", " "Shell Command Language",
  262. .IR "\fIrenice\fR\^"
  263. .P
  264. The Base Definitions volume of POSIX.1\(hy2017,
  265. .IR "Section 3.244" ", " "Nice Value",
  266. .IR "Chapter 8" ", " "Environment Variables",
  267. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  268. .P
  269. The System Interfaces volume of POSIX.1\(hy2017,
  270. .IR "\fInice\fR\^(\|)"
  271. .\"
  272. .SH COPYRIGHT
  273. Portions of this text are reprinted and reproduced in electronic form
  274. from IEEE Std 1003.1-2017, Standard for Information Technology
  275. -- Portable Operating System Interface (POSIX), The Open Group Base
  276. Specifications Issue 7, 2018 Edition,
  277. Copyright (C) 2018 by the Institute of
  278. Electrical and Electronics Engineers, Inc and The Open Group.
  279. In the event of any discrepancy between this version and the original IEEE and
  280. The Open Group Standard, the original IEEE and The Open Group Standard
  281. is the referee document. The original Standard can be obtained online at
  282. http://www.opengroup.org/unix/online.html .
  283. .PP
  284. Any typographical or formatting errors that appear
  285. in this page are most likely
  286. to have been introduced during the conversion of the source files to
  287. man page format. To report such errors, see
  288. https://www.kernel.org/doc/man-pages/reporting_bugs.html .