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.3p (3457B)


  1. '\" et
  2. .TH NICE "3P" 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 change the nice value of a process
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .P
  18. int nice(int \fIincr\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fInice\fR()
  23. function shall add the value of
  24. .IR incr
  25. to the nice value of the calling process. A nice value of a process is
  26. a non-negative number for which a more positive value shall result in
  27. less favorable scheduling.
  28. .P
  29. A maximum nice value of 2*{NZERO}\-1 and a minimum nice value of 0
  30. shall be imposed by the system. Requests for values above or below
  31. these limits shall result in the nice value being set to the
  32. corresponding limit. Only a process with appropriate privileges can
  33. lower the nice value.
  34. .P
  35. Calling the
  36. \fInice\fR()
  37. function has no effect on the priority of processes or threads with
  38. policy SCHED_FIFO or SCHED_RR.
  39. The effect on processes or threads with other scheduling policies is
  40. implementation-defined.
  41. .P
  42. The nice value set with
  43. \fInice\fR()
  44. shall be applied to the process. If the process is multi-threaded,
  45. the nice value shall affect all system scope threads in the process.
  46. .P
  47. As \-1 is a permissible return value in a successful situation, an
  48. application wishing to check for error situations should set
  49. .IR errno
  50. to 0, then call
  51. \fInice\fR(),
  52. and if it returns \-1, check to see whether
  53. .IR errno
  54. is non-zero.
  55. .SH "RETURN VALUE"
  56. Upon successful completion,
  57. \fInice\fR()
  58. shall return the new nice value \-{NZERO}.
  59. Otherwise, \-1 shall be returned, the nice value of the process
  60. shall not be changed, and
  61. .IR errno
  62. shall be set to indicate the error.
  63. .SH ERRORS
  64. The
  65. \fInice\fR()
  66. function shall fail if:
  67. .TP
  68. .BR EPERM
  69. The
  70. .IR incr
  71. argument is negative and the calling process does not have appropriate
  72. privileges.
  73. .LP
  74. .IR "The following sections are informative."
  75. .SH EXAMPLES
  76. .SS "Changing the Nice Value"
  77. .P
  78. The following example adds the value of the
  79. .IR incr
  80. argument, \-20, to the nice value of the calling process.
  81. .sp
  82. .RS 4
  83. .nf
  84. #include <unistd.h>
  85. \&...
  86. int incr = -20;
  87. int ret;
  88. .P
  89. ret = nice(incr);
  90. .fi
  91. .P
  92. .RE
  93. .SH "APPLICATION USAGE"
  94. None.
  95. .SH RATIONALE
  96. None.
  97. .SH "FUTURE DIRECTIONS"
  98. None.
  99. .SH "SEE ALSO"
  100. .IR "\fIexec\fR\^",
  101. .IR "\fIgetpriority\fR\^(\|)"
  102. .P
  103. The Base Definitions volume of POSIX.1\(hy2017,
  104. .IR "\fB<limits.h>\fP",
  105. .IR "\fB<unistd.h>\fP"
  106. .\"
  107. .SH COPYRIGHT
  108. Portions of this text are reprinted and reproduced in electronic form
  109. from IEEE Std 1003.1-2017, Standard for Information Technology
  110. -- Portable Operating System Interface (POSIX), The Open Group Base
  111. Specifications Issue 7, 2018 Edition,
  112. Copyright (C) 2018 by the Institute of
  113. Electrical and Electronics Engineers, Inc and The Open Group.
  114. In the event of any discrepancy between this version and the original IEEE and
  115. The Open Group Standard, the original IEEE and The Open Group Standard
  116. is the referee document. The original Standard can be obtained online at
  117. http://www.opengroup.org/unix/online.html .
  118. .PP
  119. Any typographical or formatting errors that appear
  120. in this page are most likely
  121. to have been introduced during the conversion of the source files to
  122. man page format. To report such errors, see
  123. https://www.kernel.org/doc/man-pages/reporting_bugs.html .