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

sleep.1p (5202B)


  1. '\" et
  2. .TH SLEEP "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. sleep
  12. \(em suspend execution for an interval
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. sleep \fItime\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR sleep
  21. utility shall suspend execution for at least the integral number of
  22. seconds specified by the
  23. .IR time
  24. operand.
  25. .SH OPTIONS
  26. None.
  27. .SH OPERANDS
  28. The following operand shall be supported:
  29. .IP "\fItime\fR" 10
  30. A non-negative decimal integer specifying the number of seconds for
  31. which to suspend execution.
  32. .SH STDIN
  33. Not used.
  34. .SH "INPUT FILES"
  35. None.
  36. .SH "ENVIRONMENT VARIABLES"
  37. The following environment variables shall affect the execution of
  38. .IR sleep :
  39. .IP "\fILANG\fP" 10
  40. Provide a default value for the internationalization variables that are
  41. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  42. .IR "Section 8.2" ", " "Internationalization Variables"
  43. for the precedence of internationalization variables used to determine
  44. the values of locale categories.)
  45. .IP "\fILC_ALL\fP" 10
  46. If set to a non-empty string value, override the values of all the
  47. other internationalization variables.
  48. .IP "\fILC_CTYPE\fP" 10
  49. Determine the locale for the interpretation of sequences of bytes of
  50. text data as characters (for example, single-byte as opposed to
  51. multi-byte characters in arguments).
  52. .IP "\fILC_MESSAGES\fP" 10
  53. .br
  54. Determine the locale that should be used to affect the format and
  55. contents of diagnostic messages written to standard error.
  56. .IP "\fINLSPATH\fP" 10
  57. Determine the location of message catalogs for the processing of
  58. .IR LC_MESSAGES .
  59. .SH "ASYNCHRONOUS EVENTS"
  60. If the
  61. .IR sleep
  62. utility receives a SIGALRM signal, one of the following actions shall
  63. be taken:
  64. .IP " 1." 4
  65. Terminate normally with a zero exit status.
  66. .IP " 2." 4
  67. Effectively ignore the signal.
  68. .IP " 3." 4
  69. Provide the default behavior for signals described in the ASYNCHRONOUS
  70. EVENTS section of
  71. .IR "Section 1.4" ", " "Utility Description Defaults".
  72. This could include terminating with a non-zero exit status.
  73. .P
  74. The
  75. .IR sleep
  76. utility shall take the standard action for all other signals.
  77. .SH STDOUT
  78. Not used.
  79. .SH STDERR
  80. The standard error shall be used only for diagnostic messages.
  81. .SH "OUTPUT FILES"
  82. None.
  83. .SH "EXTENDED DESCRIPTION"
  84. None.
  85. .SH "EXIT STATUS"
  86. The following exit values shall be returned:
  87. .IP "\00" 6
  88. The execution was successfully suspended for at least
  89. .IR time
  90. seconds, or a SIGALRM signal was received. See the ASYNCHRONOUS EVENTS
  91. section.
  92. .IP >0 6
  93. An error occurred.
  94. .SH "CONSEQUENCES OF ERRORS"
  95. Default.
  96. .LP
  97. .IR "The following sections are informative."
  98. .SH "APPLICATION USAGE"
  99. None.
  100. .SH EXAMPLES
  101. The
  102. .IR sleep
  103. utility can be used to execute a command after a certain amount of
  104. time, as in:
  105. .sp
  106. .RS 4
  107. .nf
  108. (sleep 105; \fIcommand\fP) &
  109. .fi
  110. .P
  111. .RE
  112. .P
  113. or to execute a command every so often, as in:
  114. .sp
  115. .RS 4
  116. .nf
  117. while true
  118. do
  119. \fIcommand\fP
  120. sleep 37
  121. done
  122. .fi
  123. .P
  124. .RE
  125. .SH RATIONALE
  126. The exit status is allowed to be zero when
  127. .IR sleep
  128. is interrupted by the SIGALRM signal because most implementations of
  129. this utility rely on the arrival of that signal to notify them that the
  130. requested finishing time has been successfully attained. Such
  131. implementations thus do not distinguish this situation from the
  132. successful completion case. Other implementations are allowed to catch
  133. the signal and go back to sleep until the requested time expires or to
  134. provide the normal signal termination procedures.
  135. .P
  136. As with all other utilities that take integral operands and do not
  137. specify subranges of allowed values,
  138. .IR sleep
  139. is required by this volume of POSIX.1\(hy2017 to deal with
  140. .IR time
  141. requests of up to 2\|147\|483\|647 seconds. This may mean that some
  142. implementations have to make multiple calls to the delay mechanism of
  143. the underlying operating system if its argument range is less than
  144. this.
  145. .SH "FUTURE DIRECTIONS"
  146. None.
  147. .SH "SEE ALSO"
  148. .IR "\fIwait\fR\^"
  149. .P
  150. The Base Definitions volume of POSIX.1\(hy2017,
  151. .IR "Chapter 8" ", " "Environment Variables"
  152. .P
  153. The System Interfaces volume of POSIX.1\(hy2017,
  154. .IR "\fIalarm\fR\^(\|)",
  155. .IR "\fIsleep\fR\^(\|)"
  156. .\"
  157. .SH COPYRIGHT
  158. Portions of this text are reprinted and reproduced in electronic form
  159. from IEEE Std 1003.1-2017, Standard for Information Technology
  160. -- Portable Operating System Interface (POSIX), The Open Group Base
  161. Specifications Issue 7, 2018 Edition,
  162. Copyright (C) 2018 by the Institute of
  163. Electrical and Electronics Engineers, Inc and The Open Group.
  164. In the event of any discrepancy between this version and the original IEEE and
  165. The Open Group Standard, the original IEEE and The Open Group Standard
  166. is the referee document. The original Standard can be obtained online at
  167. http://www.opengroup.org/unix/online.html .
  168. .PP
  169. Any typographical or formatting errors that appear
  170. in this page are most likely
  171. to have been introduced during the conversion of the source files to
  172. man page format. To report such errors, see
  173. https://www.kernel.org/doc/man-pages/reporting_bugs.html .