1PAUSE(3P) POSIX Programmer's Manual PAUSE(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 pause — suspend the thread until a signal is received
13
15 #include <unistd.h>
16
17 int pause(void);
18
20 The pause() function shall suspend the calling thread until delivery of
21 a signal whose action is either to execute a signal-catching function
22 or to terminate the process.
23
24 If the action is to terminate the process, pause() shall not return.
25
26 If the action is to execute a signal-catching function, pause() shall
27 return after the signal-catching function returns.
28
30 Since pause() suspends thread execution indefinitely unless interrupted
31 by a signal, there is no successful completion return value. A value of
32 -1 shall be returned and errno set to indicate the error.
33
35 The pause() function shall fail if:
36
37 EINTR A signal is caught by the calling process and control is
38 returned from the signal-catching function.
39
40 The following sections are informative.
41
43 None.
44
46 Many common uses of pause() have timing windows. The scenario involves
47 checking a condition related to a signal and, if the signal has not
48 occurred, calling pause(). When the signal occurs between the check
49 and the call to pause(), the process often blocks indefinitely. The
50 sigprocmask() and sigsuspend() functions can be used to avoid this type
51 of problem.
52
54 None.
55
57 None.
58
60 sigsuspend()
61
62 The Base Definitions volume of POSIX.1‐2017, <unistd.h>
63
65 Portions of this text are reprinted and reproduced in electronic form
66 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
67 table Operating System Interface (POSIX), The Open Group Base Specifi‐
68 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
69 Electrical and Electronics Engineers, Inc and The Open Group. In the
70 event of any discrepancy between this version and the original IEEE and
71 The Open Group Standard, the original IEEE and The Open Group Standard
72 is the referee document. The original Standard can be obtained online
73 at http://www.opengroup.org/unix/online.html .
74
75 Any typographical or formatting errors that appear in this page are
76 most likely to have been introduced during the conversion of the source
77 files to man page format. To report such errors, see https://www.ker‐
78 nel.org/doc/man-pages/reporting_bugs.html .
79
80
81
82IEEE/The Open Group 2017 PAUSE(3P)