Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

44. Pipes and FIFOs > Semantics of read() and write() on Pipes and FIFOs

Semantics of read() and write() on Pipes and FIFOs

Table 44-2 summarizes the operation of read() for pipes and FIFOs, and includes the effect of the O_NONBLOCK flag.

The only difference between blocking and nonblocking reads occurs when no data is present and the write end is open. In this case, a normal read() blocks, while a nonblocking read() fails with the error EAGAIN.

Table 44-2. Semantics of reading n bytes from a pipe or FIFO containing p bytes

O_NONBLOCK enabled?

Data bytes available in pipe or FIFO (p)


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint