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]


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 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.


> 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.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


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