This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Curious behavior of fifo on cygwin 1.7.5


Hello,

I currently have a curious behavior with fifo (named pipes on cygwin
1.7.5) . I first discovered when using Nagios on cygwin but I achieved
to simplify it . The scenario is the following :
- Creating a fifo with mkfifo /tmp/fifo.cmd
- In a C program (attached)
- open in text read mode
- Read with fgets
- In a second shell, echo "foo" >/tmp/fifo.cmd

The behavior is :
- The first fgets is a blocking read up to a write in the path (with
echo) => expected behavior
- It seems that the text is red 2 times
- The following fgets are not more blocking read
- The following write (with echo) are blocked as if there is no reading process.
- The fgets do not find the written elements in the fifo

I execute the same command on linux (RHEL 4) and I had a more
conventional behavior
- blocking read
- No problems with following write (2nd, 3rd echo)

Attached :
- Consumer of fifo : consume_fifo.c
- Producer of fifo : produce_fifo.sh
- System report : cygcheck.out

In the mailing list, I saw some problems with select and fifo but I
didn't achieve to link to this issue . So
1) Is this behavior linked to an already known bug ?
2) Is there workaround to have the Linux behavior ?

Thanks in advance,

Best Regards,

Etienne Carrière

Attachment: produce_fifo.sh
Description: Bourne shell script

Attachment: cygcheck.out
Description: Binary data

Attachment: consume_fifo.c
Description: Binary data

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]