In Linux, except for the socket case, read() is a blocking function. But when I fork the process, the parent process returns 0 by read(). I wonder why? Can read not read because the child process has not written for too long and therefore returns 0?
Asked
Active
Viewed 78 times
0
-
Does this answer your question? [Under what circumstances does the read() syscall return 0?](https://stackoverflow.com/questions/51411385/under-what-circumstances-does-the-read-syscall-return-0) – alagner May 04 '22 at 09:38
-
Thanks!! That's very relevant to my question, but I have a further question, is there a time limit between reads? Since IT will take me some time to write, the buffer will be empty during that time, so the return value will be zero. – gazile May 04 '22 at 09:52