Re: poll() returns POLLIN but no data ?
joe_at_invalid.address
Date: 06/27/05
- Next message: Loic Domaigne: "Re: Testing system call return values"
- Previous message: Stephen: "Re: Any standard way to fork and exec something that isn't in a file?"
- In reply to: Maxim Yegorushkin: "Re: poll() returns POLLIN but no data ?"
- Next in thread: Barry Margolin: "Re: poll() returns POLLIN but no data ?"
- Reply: Barry Margolin: "Re: poll() returns POLLIN but no data ?"
- Reply: David Schwartz: "Re: poll() returns POLLIN but no data ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 Jun 2005 18:52:48 -0500
"Maxim Yegorushkin" <firstname.lastname@gmail.com> writes:
> On Sun, 26 Jun 2005 23:32:46 +0400, David Schwartz
> <davids@webmaster.com> wrote:
> >> Using blocking sockets with select/poll/epoll/... is fine,
> >> read/write won't block if the descriptor has been indicated to be
> >> ready for that operation and this is guarantied by
> >> POSIX. Blocking accept() can block after a socket has been
> >> indicated as ready for read because a client could bail out
> >> before you call accept.
> >
> > It is not guaranteed by POSIX, and it cannot be guaranteed.
>
> I thought this guaranties that
> http://www.opengroup.org/onlinepubs/009695399/functions/select.html
>
> Why can't it be guaranteed?
David has a different idea about what "blocking" means than many other
people do. He includes things like short waits for page faults to be
blocking. I don't, and many others don't, but there it is.
Even if you take his view though, the standard says
"A descriptor shall be considered ready for reading when a call to
an input function with O_NONBLOCK clear would not block, whether or
not the function would transfer data successfully. (The function
might return data, an end-of-file indication, or an error other
than one indicating that it is blocked, and in each of these cases
the descriptor shall be considered ready for reading.)
A descriptor shall be considered ready for writing when a call to
an output function with O_NONBLOCK clear would not block, whether
or not the function would transfer data successfully."
So whatever you define as blocking the standard says it won't. It may
be that the standard is wrong to say this (at least without
qualification), but it does say it.
One thing that can be guaranteed is that you won't change his mind
about it :-)
Joe
- Next message: Loic Domaigne: "Re: Testing system call return values"
- Previous message: Stephen: "Re: Any standard way to fork and exec something that isn't in a file?"
- In reply to: Maxim Yegorushkin: "Re: poll() returns POLLIN but no data ?"
- Next in thread: Barry Margolin: "Re: poll() returns POLLIN but no data ?"
- Reply: Barry Margolin: "Re: poll() returns POLLIN but no data ?"
- Reply: David Schwartz: "Re: poll() returns POLLIN but no data ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|