Why the following program doesn't block on the second read call?
int pid = fork(); if(pid) { int fifo = open("testfifo", O_RDWR); char buf[20]; while(1) { read(fifo, buf, 10); puts(buf); } } else { int fifo = open("testfifo", O_WRONLY); write(fifo, "teststring", 10); close(fifo); } return 0; The second read call continues returning 0 even though the fifo become empty and it should block on the read call.
Am I missing something?
The OS is Windows and the pipe has been created with a mknod testfifo p.