[PATCH] Allow system call restarts upon signal interruption

Adam Jackson ajax at nwnk.net
Wed May 13 09:41:46 PDT 2015


On Tue, 2015-05-12 at 16:39 -0600, Daniel Drake wrote:
> The X server frequently deals with SIGIO and SIGALRM interruptions.
> If process execution is inside certain blocking system calls
> when these signals arrive, e.g. with the kernel blocked on
> a contended semaphore, the system calls will be interrupted.
> 
> Some system calls are automatically restartable (the kernel re
> -executes
> them with the same parameters once the signal handler returns) but
> only if the signal handler allows it.
> 
> Set SA_RESTART on the signal handlers to enable this convenient
> behaviour.

In principle SA_RESTART is so poorly specified that this might be
sketchy; in practice, near as I can tell, nobody is insane enough to
do restarts on select() and friends, so I think we'll be fine.

Reviewed-by: Adam Jackson <ajax at redhat.com>

- ajax


More information about the xorg-devel mailing list