long restart_syscall(void);
注: このシステムコールには、glibc のラッパー関数はない。「注意」の節を参照。
restart_syscall() is used for restarting only those system calls that, when restarted, should adjust their time-related parameters---namely poll(2) (since Linux 2.6.24), nanosleep(2) (since Linux 2.6), clock_nanosleep(2) (since Linux 2.6), and futex(2), when employed with the FUTEX_WAIT (since Linux 2.6.22) and FUTEX_WAIT_BITSET (since Linux 2.6.31) operations. restart_syscall() restarts the interrupted system call with a time argument that is suitably adjusted to account for the time that has already elapsed (including the time where the process was stopped by a signal). Without the restart_syscall() mechanism, restarting these system calls would not correctly deduct the already elapsed time when the process continued execution.
カーネルは restart_syscall() を使用することで、 シグナルにより停止されたプロセスが SIGCONT により再開された後にシステムコールが再開される際に、 元のシステムコールに指定されたタイムアウト時間の計算に、 プロセスが停止中に経過した時間が含まれることを保証する。 タイムアウト引数を取り、停止シグナルの後に SIGCONT があった場合自動的に再開するシステムコールだが、 そのシステムコールに restart_syscall() の仕組みが組込まれていない場合には、 プロセスの実行が再開された後、 停止中にプロセスが消費した時間はタイムアウト値としてカウント「されない」。 この問題を持つ有名なシステムコールとしては ppoll(2), select(2), pselect(2) がある。
ユーザー空間からは restart_syscall() の動作はほとんど見えない。 再開されたシステムコールを呼び出したプロセスには、 そのシステムコールが通常通り実行され返ったように見える。