In a multi threaded application all threads block all signals and a single thread does the signal handling in a loop with sigwait
. Now should we consider EINTR
after using system calls like read
and write
in other threads?
while (true)
{
num = read(fd, buf, size);
if (num == -1 && errno == EINTR)
continue;
else if (num > 0)
/* handle the buf and read more */
}