I call write()
in my SIGCHLD signal handler.
But write()
may sometimes set errno
. Will this break my program?
Should I save and then restore errno
like the following?
void sigchld_hanlder(int)
{
int old_errno = errno;
write(...);
errno = old_errno;
}