lkml.org 
[lkml]   [1998]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Problem with FIFO reads from multiple processes, not sure if bug or normal behavior
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.026 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site