This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fwd: I/O errors - confusion]


On Tue, 2003-03-18 at 11:44, Nick Garnett wrote:
> Gary Thomas <gary at mlbassoc dot com> writes:
> 
> > 
> > I agree - either there is data or not and the return code should
> > be very clear: EAGAIN means there is none, anything else means
> > there was.  I think that the code in serial.c you quote should
> > return no error when there is data.
> 
> That is exactly my interpretation of what should happen. The only real
> question is whether we should make that change, or just fix it in the
> fileio code. I would vote for the former, since it results in code
> being removed, but we have to be sure we are not breaking anything
> else by doing it.
> 

I propose that we change it (serial.c) - trunk only.  I think it
should be OK, especially if we put in the change to devfs.c which
is just safety (if the low level driver works).

> > 
> > I am still not sure that we are using the errors in the proper
> > "state" (sometimes they are positive, sometimes negative).
> >
> 
> History. When you originally wrote the device driver subsystem you
> adopted the Linux practice of returning negative error codes. However
> the BSD practice is to return positive codes, which I adopted in the
> FILEIO subsystem to avoid doing lots of translation for the net
> stack. Hence the devfs translates from negative to positive codes in
> places.
> 
> It's yukky, but I suspect that we cannot change it now.
> 

Fair enough - best left for another day.

> 
> > Actually, finding this was a side effect of my problems with
> > VMIN (on a device which does not have O_NONBLOCK set).  I'd
> > really appreciate some discussion on that as well.
> > 
> 
> Not my area I'm afraid. I think this is Jifl's baby. I do recall some
> real-life discussions that resulted in us deciding to punt on some of
> the more complex termio features. But I'm not sure whether this was
> one of them.
> 
> For what it's worth, your VMIN patch looks OK to me.
>

Thanks.

-- 
------------------------------------------------------------
Gary Thomas                 |
MLB Associates              |  Consulting for the
+1 (970) 229-1963           |    Embedded world
http://www.mlbassoc.com/    |
email: <gary at mlbassoc dot com>  |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]