[Bug 1245] device_lseek is noop but always returns success

rtems-bugs at rtems.org rtems-bugs at rtems.org
Wed Aug 15 14:22:55 UTC 2007


------- Comment #3 from joel.sherrill at oarcorp.com  2007-08-15 09:22 -------
(In reply to comment #2)
> For some devices (seekable ones that need no special action in the device
> driver)
> the current behavior is almost OK (the file pointer is adjusted in
> libcsupport/src/lseek.c and the adjustment reverted if the
> iop->handlers->lseek_h() 'method' returns -1). However, the value returned
> by device_lseek() should not be zero but the current offset. IMO that is better
> than what we have now and simple to implement although it doesn't provide a way
> for non-seekable device drivers to return ESPIPE.

I think it might be worth considering adding a but to flags
in rtems_libio_tt indicating that a particular libio file is non-seekable.  
Then it could be checked in the *seek() calls.  Look for LIBIO_FLAGS_XXX
in rtems/libio.h.  There are plenty of bits.  

If you want to prepare a patch and attach it, I will commit it.  I think just
adding a non-seekable bit for libio flags, checking it in *seek() and making
the  file specific handlers mark it would work

Configure bugmail: http://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.

More information about the bugs mailing list