linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* EAGAIN with read
@ 2007-12-06 20:14 Saurabh Sehgal
  2007-12-06 21:29 ` Steve Graegert
  0 siblings, 1 reply; 5+ messages in thread
From: Saurabh Sehgal @ 2007-12-06 20:14 UTC (permalink / raw)
  To: linux-c-programming

Hi,

I had a basic question about read . I have a file descriptor marked
with non blocking I/O , and I want to read data from the file
descriptor. This file descriptor is the read end of a UNIX pipe.

 The process that the pipe reads from is a very slow process. Hence I
need to poll  and keep on trying to read from the fd until the process
has actually written something to the pipe. I execute read while the
errno condition EAGAIN is true. Will this ever result in an infinite
loop ? (lets say the remote process dies and doesnt write anything to
the pipe, will I go into an infinite loop since I am polling while
EAGAIN is true ?).

Any help is appreciated. Thank you.

-- S

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-10 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-06 20:14 EAGAIN with read Saurabh Sehgal
2007-12-06 21:29 ` Steve Graegert
2007-12-06 23:27   ` Saurabh Sehgal
2007-12-08 19:12     ` Steve Graegert
2007-12-10 16:21       ` Saurabh Sehgal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).