From: "Saurabh Sehgal" <saurabh.r.s@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: EAGAIN with read
Date: Thu, 6 Dec 2007 15:14:44 -0500 [thread overview]
Message-ID: <2a46ebd60712061214p2febc3d0pbe4fd688911356f7@mail.gmail.com> (raw)
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
next reply other threads:[~2007-12-06 20:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-06 20:14 Saurabh Sehgal [this message]
2007-12-06 21:29 ` EAGAIN with read Steve Graegert
2007-12-06 23:27 ` Saurabh Sehgal
2007-12-08 19:12 ` Steve Graegert
2007-12-10 16:21 ` Saurabh Sehgal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a46ebd60712061214p2febc3d0pbe4fd688911356f7@mail.gmail.com \
--to=saurabh.r.s@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).