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