no more errno after device read?

Joel Sherrill joel.sherrill at OARcorp.com
Tue Jun 12 13:37:38 UTC 2001



Thomas Doerfler wrote:
> 
> Hi,
> 
> I am currently fussing around with PPP-related error handling under
> rtems-4.5.0 (the released sources, not a snapshot). I am suprised to
> see, that "errno" is no longer set, when an error occures in the
> device drivers read function, although it was set under rtems-4.0.0.
> 
> I know that there were significant changes due to IMFS
> infrastructure. Under rtems-4.0.0, the device driver returned an
> error code to __rtems_read (file: libio.c), and there it was
> translated into errno using rtems_libio_errno().
> Under rtems-4.5.0, the corresponding function device_read (file:
> deviceio.c) returns a -1 if an error was reported, but does not set
> errno.
> 
> According to the Linux man pages, "read()" should set errno if an
> error occured, so I think it is a bit of an illegal shortcut to drop
> any error reason code in device_read().
> 
> Has this bug already been discussed? (or even fixed?)

In a single word -- no.  

This all boils down to one file (libfs/src/imfs/deviceio.c) and all
the routines are pretty simple wrappers for the IO manager.  They
also just do "if (status) return -1;"  So it should be easy for
you to fix.

> bye,
>         Thomas.
> 
> --------------------------------------------
> IMD Ingenieurbuero fuer Microcomputertechnik
> Thomas Doerfler           Herbststrasse 8
> D-82178 Puchheim          Germany
> email:    Thomas.Doerfler at imd-systems.de
> PGP public key available at: http://www.imd-systems.de/pgp_key.htm

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list