Cancel read on socket
Ralf Corsepius
ralf.corsepius at rtems.org
Wed May 28 06:51:24 UTC 2008
On Wed, 2008-05-28 at 09:22 +0300, Leon Pollak wrote:
> On Wednesday, 28 בMay 2008, Chris Johns wrote:
> > Joel Sherrill wrote:
> > > Without thinking about compatibility at all, shouldn't it be
> > > possible to add an RTEMS specific IOCTL which forced
> > > a read() to return an error like ECANCELED?
> >
> > I do not think this is a good idea. Other ways to solve this problem have
> > been suggested.
I agree with Chris.
> As someone who feels strong interest in this, can I ask the question - why is
> this not a good idea?
It is very error prone and difficult to implement.
Think along these lines from POSIX:
...
If a read() is interrupted by a signal before it reads any data, it
shall return -1 with errno set to [EINTR].
If a read() is interrupted by a signal after it has successfully read
some data, it shall return the number of bytes read.
...
How would you handle canceling io?
In addition to that, I am opposed to adding anything proprietary to a
standardized API.
Ralf
More information about the users
mailing list