1RESTART_SYSCALL(2) Linux Programmer's Manual RESTART_SYSCALL(2)
2
3
4
6 restart_syscall - restart a system call after interruption by a stop
7 signal
8
10 int restart_syscall(void);
11
12 Note: There is no glibc wrapper for this system call; see NOTES.
13
15 The restart_syscall() system call is used to restart certain system
16 calls after a process that was stopped by a signal (e.g., SIGSTOP or
17 SIGTSTP) is later resumed after receiving a SIGCONT signal. This sys‐
18 tem call is designed only for internal use by the kernel.
19
20 restart_syscall() is used for restarting only those system calls that,
21 when restarted, should adjust their time-related parameters—namely
22 poll(2) (since Linux 2.6.24), nanosleep(2) (since Linux 2.6),
23 clock_nanosleep(2) (since Linux 2.6), and futex(2), when employed with
24 the FUTEX_WAIT (since Linux 2.6.22) and FUTEX_WAIT_BITSET (since Linux
25 2.6.31) operations. restart_syscall() restarts the interrupted system
26 call with a time argument that is suitably adjusted to account for the
27 time that has already elapsed (including the time where the process was
28 stopped by a signal). Without the restart_syscall() mechanism,
29 restarting these system calls would not correctly deduce the already
30 elapsed time when the process continued execution.
31
33 The return value of restart_syscall() is the return value of whatever
34 system call is being restarted.
35
37 errno is set as per the errors for whatever system call is being
38 restarted by restart_syscall().
39
41 The restart_syscall() system call is present since Linux 2.6.
42
44 This system call is Linux specific.
45
47 There is no glibc wrapper for this system call, because it is intended
48 for use only by the kernel and should never be called by applications.
49
50 From user space, the operation of restart_syscall(2) is largely invisi‐
51 ble: to the process that made the system call that is restarted, it
52 appears as though that system call executed and returned in the usual
53 fashion.
54
56 sigreturn(2), sigaction(2), signal(7)
57
59 This page is part of release 3.53 of the Linux man-pages project. A
60 description of the project, and information about reporting bugs, can
61 be found at http://www.kernel.org/doc/man-pages/.
62
63
64
65Linux 2013-07-30 RESTART_SYSCALL(2)