I've found this piece of code used several times (also a similar one where it's used open()
instead of write()
).
int c = write(fd, &v, sizeof(v));
if (c == -1 && errno != EINTR) {
perror("Write to output file");
exit(EXIT_FAILURE);
}
Why it is checked if && errno != EINTR
here ?
Looking for errno
on man I found the following text about EINTR
, but even if I visited man 7 signal
that doesn't enlighten me.
EINTR Interrupted function call (POSIX.1); see signal(7).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…