Messages in this thread | | | From | (Miquel van Smoorenburg) | Subject | Re: Problem with FIFO reads from multiple processes, not sure if bug or normal behavior | Date | 10 Nov 1998 13:06:09 +0100 |
| |
In article <cistron.007401be0c60$935b9900$04c809c0@Fake.Domain.com>, Anthony Barbachan <barbacha@Hinako.AMBusiness.com> wrote: >I am writing a program the uses FIFOs to receive commands from multiple >separate processes. After one process is finished sending data through the >FIFO and closes it, the select call always returns immediately after being >called, weather data is available or not.
The read() in the listening process returns 0 bytes so you know EOF was reached (the only writer to the pipe has gone). Normally you close() the pipe and exit(), or re-open() it.
Alternatively open the FIFO in O_RDWR mode in the listening process, so that there always is one writer (the process itself) and you will never reach EOF
Mike. -- Indifference will certainly be the downfall of mankind, but who cares?
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |