LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Read and write in fifo (https://www.linuxquestions.org/questions/programming-9/read-and-write-in-fifo-4175560974/)

blastfox 12-08-2015 11:19 AM

Read and write in fifo
 
Some weeks ago I asked about read and write in fifo. But I didn't formulate my question clearly. I also asked my teacher, but he couldn't answer. Question: when we open fifo for write with NON_BLOCK flag(fifo hasn't read fd) system returns error, but when we open it only for read returns OK. Why does function open with NON_BLOCK implement such way? Why it isn't implemented in a different way: (write and read) return error or return OK?
UPD: in C, use mkfifo

pan64 12-08-2015 12:01 PM

I think it is in C, but probably not. Can you please post a sample code to show exactly what do you mean?

business_kid 12-08-2015 12:09 PM

Never done it in C, but on CLI. Did you use mkfifo (or the equivalent?)
There are some info pages on C programming, which some distro packages redistribute. You can run info printf for instance. you're told what header to include, etc.


All times are GMT -5. The time now is 01:56 PM.