I've been using PHP's PCNTL extension for a little while now, but can't figure out what the restart_syscalls
parameter of pcntl_signal()
does. I tried looking around the Internets, but couldn't find any information. All the documentation says is:
"Specifies whether system call restarting should be used when this signal arrives."
What is "system call restarting"?
Suppose you programmed your signal handler to stop a process using signals like:
restart_syscalls
specifies whether system call restarting should be used whensigno
arrives. Examples ofsigno
are the three I listed above and there are much more.This means, if
restart_syscalls
is set to the default value TRUE, this will restart certain system calls after a process that was stopped by a signalsigno
. It restarts the interrupted system call with a time argument that is suitably adjusted to account for the time that has already elapsed.I forward you to this very simple and clear example: pcntl_wait not interrupted by SIGTERM