RE: select() fails... sometimes

=?iso-8859-1?Q?Miguel_Angel_Garc=EDa_Grande?= (mgarcia@bjssoft.es)
Mon, 24 May 1999 08:46:43 +0200


Kurt,

That's right. If read() returns zero... it means the stream is over.
So, finally, both select() and read() behave correctly. I have a lot to
learn... as you see.

Thank you VERY much!

-----Original Message-----
From: Rogier Wolff [mailto:R.E.Wolff@BitWizard.nl]
Sent: 22 May 1999 22:20
To: mgarcia@bjssoft.es
Cc: garloff@suse.de; linux-kernel@vger.rutgers.edu
Subject: Re: select() fails... sometimes

Miguel Angel García Grande wrote:
> Thank you very much, Kurt.
>
> The reason seems to be a feature I didn't know: If select() indicates you
> can read from a handle but read() really gets nothing, it means the handle
^^^^^^^^^^^^^^^^^ returns zero
> has some kind of error (connection closed, etc).
^^^^^^^^ NO!

returning 0 is completely different from "error". It is the standard
"end of file" indication.

You should also note that errno is not modified in that case.

Roger.

--
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
------ Microsoft SELLS you Windows, Linux GIVES you the whole house ------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/