[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Cancel read on socket
- Date: Wed, 28 May 2008 08:51:24 +0200
- From: ralf.corsepius at rtems.org (Ralf Corsepius)
- Subject: Cancel read on socket
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