See sigaction : http://pubs.opengroup.org/onlinepubs/009695399/functions/sigaction.html
SA_RESTART
This flag affects the behavior of interruptible functions; that is, those
specified to fail with errno set to EINTR. If set, and a function specified
as interruptible is interrupted by this signal, the function shall restart
and shall not fail with EINTR unless otherwise specified. If the flag is not
set, interruptible functions interrupted by this signal shall fail with errno
set to EINTR.
By default, you have the SA_RESTART behavior, so you don't have to worry about EINTR, if you don't play with signals.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…