device driver code that can response to SEEK_END

Pattara Kiatisevi pkiatisevi at student.ei.uni-stuttgart.de
Wed Apr 24 14:26:36 UTC 2002


Hi all,

I still have problem with this seeking problem with my device driver code.
I found it has problem when there is a call fseek(x,0,SEEK_END). Anybody
has idea how should i write the device driver code to let this SEEK_END
work. I mean how should I update these variables:

typedef struct {
    rtems_libio_t          *iop;
    off_t                   offset;
    unsigned8              *buffer;
    unsigned32              count;
    unsigned32              flags;
    unsigned32              bytes_moved;
} rtems_libio_rw_args_t;

So far I just check if offset > mydatasize then return with bytes_moved =
0;

Thank you very much,
Pattara
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
----------------------------------------------------------------------
Ott Pattara Kiatisevi 				   T L W G
M.Sc. INFOTECH Student, Stuttgart, Germany	http://linux.thai.net/
----------------------------------------------------------------------




More information about the users mailing list