How to know write end of FIFO has closed

sandeep_onsite_at_yahoo.com
Date: 01/20/05

  • Next message: Ian Stirling: "Re: How to know write end of FIFO has closed"
    Date: 20 Jan 2005 03:27:42 -0800
    
    

    Hi,

    How to check write end of a FIFO has been closed?
    My problem:

    My Linux syslog daemon(syslogd) is sending the syslog messages to a
    FIFO. my application daemon program keeps reading from FIFO using
    blocking read() call.
    When syslogd terminates, read() call always returns 0 bytes, indicating
    EOF. But how do I confirm 0 bytes read was due to syslogd closing the
    write end of the FIFO. Is there any way to check that write end is
    closed.

    Appreciate any help.

    Thanks in advance,
    Sandeep


  • Next message: Ian Stirling: "Re: How to know write end of FIFO has closed"

    Relevant Pages

    • fork process to handle fifo input
      ... has the purpose to collect log entries generated by iptables through ... must collect the log entries coming through the fifo and prepare them ... data from syslog through the fifo as they should. ... that syslog is generating approx 200 entires per second. ...
      (comp.lang.perl.misc)
    • Platform independent reading of syslog messages
      ... I want to read all syslog messages to get them into my own application. ... I could set up a fifo and put something like ... on several platforms syslogd just stops writing if no ...
      (comp.unix.programmer)
    • Re: read from a named pipe?
      ... with syslog. ... I suspect that if syslogd gets a sigpipe writing to ... the fifo that it stops writing to that fifo. ... code to simply check for file sizes ) to know when ...
      (comp.lang.perl.misc)
    • Re: How to know write end of FIFO has closed
      ... > How to check write end of a FIFO has been closed? ... > My Linux syslog daemonis sending the syslog messages to a ... EOF on a pipe means that the write end was closed. ...
      (comp.unix.questions)
    • Re: How to know write end of FIFO has closed
      ... > How to check write end of a FIFO has been closed? ... > My Linux syslog daemonis sending the syslog messages to a ... man errno ...
      (comp.unix.questions)