[PATCH] Allow system call restarts upon signal interruption

Keith Packard keithp at keithp.com
Tue May 12 22:57:54 PDT 2015


"Jasper St. Pierre" <jasper at endlessm.com> writes:

> I don't see how that's the case. The select() call should never block, see:
>
> http://cgit.freedesktop.org/xorg/xserver/tree/os/connection.c#n1000
>
> From select(2):
>
>     If both fields of the timeval structure are zero, then select() returns
> immediately.

We pass non-zero timeouts to select on a regular basis; otherwise the
server would never stop.

However, select(2) is among the set of syscalls which are not affected
by SA_RESTART, and given that the X server should never suspend anywhere
other than within select(2), it is probably safe to use SA_RESTART for
all signals, even SIGIO (which is used to read input events, and must
wake the server up to process them).

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150512/95976b95/attachment.sig>


More information about the xorg-devel mailing list