Thanks for the comment! I agree that providing EINTR for applications that want it can possibly be useful. But I think the way it’s exposed in the API breaks the rule of “make simple things easy and hard things possible.” Since it’s very uncommon that a program wants to handle EINTR, I think it would be better to have separate versions of the functions (or a boolean parameter to these functions) that lets you enable EINTR only for calls where you want to handle it.
// Standard write() call. Will never return EINTR.
ssize_t write(int fildes, const void *buf, size_t nbyte);
// Interruptible write() call, may return EINTR.
ssize_t interruptible_write(int filedes, const void *buf,
size_t nbyte);
As it’s written, since SA_RESTART is a property of the signal handler and not of the interruptible system call itself, all such system calls are potentially interruptible, so they all have to handle EINTR.