I am using select in one of my OSX programs to watch some file descriptors. I encountered the issue with child processes on Linux that select may fail with errno set to EINTR. On Linux I have encountered this using
struct sigaction sa;
::memset(&sa, 0, sizeof(sa));
sa.sa_handler = child_death_signal_handler;
sa.sa_flags = SA_RESTART;
sigaction(SIGCHLD, &sa, NULL);
Setting the SA_RESTART flag which will eradicate the issue on Linux. On OSX however, SA_RESTART is mentioned in the manpages, but it seems to have zero effect, as my read functions, etc, still fail with EINTR as errno.
Is there some way to make this work in OSX also?