1PAUSE(P) POSIX Programmer's Manual PAUSE(P)
2
3
4
6 pause - suspend the thread until a signal is received
7
9 #include <unistd.h>
10
11 int pause(void);
12
13
15 The pause() function shall suspend the calling thread until delivery of
16 a signal whose action is either to execute a signal-catching function
17 or to terminate the process.
18
19 If the action is to terminate the process, pause() shall not return.
20
21 If the action is to execute a signal-catching function, pause() shall
22 return after the signal-catching function returns.
23
25 Since pause() suspends thread execution indefinitely unless interrupted
26 by a signal, there is no successful completion return value. A value of
27 -1 shall be returned and errno set to indicate the error.
28
30 The pause() function shall fail if:
31
32 EINTR A signal is caught by the calling process and control is
33 returned from the signal-catching function.
34
35
36 The following sections are informative.
37
39 None.
40
42 Many common uses of pause() have timing windows. The scenario involves
43 checking a condition related to a signal and, if the signal has not
44 occurred, calling pause(). When the signal occurs between the check and
45 the call to pause(), the process often blocks indefinitely. The sig‐
46 procmask() and sigsuspend() functions can be used to avoid this type of
47 problem.
48
50 None.
51
53 None.
54
56 sigsuspend() , the Base Definitions volume of IEEE Std 1003.1-2001,
57 <unistd.h>
58
60 Portions of this text are reprinted and reproduced in electronic form
61 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
62 -- Portable Operating System Interface (POSIX), The Open Group Base
63 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
64 Electrical and Electronics Engineers, Inc and The Open Group. In the
65 event of any discrepancy between this version and the original IEEE and
66 The Open Group Standard, the original IEEE and The Open Group Standard
67 is the referee document. The original Standard can be obtained online
68 at http://www.opengroup.org/unix/online.html .
69
70
71
72IEEE/The Open Group 2003 PAUSE(P)