"seekable" device

Aaron J. Grier aaron at frye.com
Thu Mar 21 18:45:15 UTC 2002


On Thu, Mar 21, 2002 at 05:17:48PM +0100, Pattara Kiatisevi wrote:

> I have a hopefully simple question about this "fseek" function. What
> will happen if an application calls "fseek" to a device? I mean, how
> can I adjust my device driver (I wrote a /dev/soundinput to simulate a
> song file) to support this seek function? Now I have only
> soundinput_initialize(), open(), close(), read(), write() and ioctl().

in the io struct (rtems_libio_rw_args_t *) passed to read and write,
there's a member "offset" which is manipulated by fseek.  it looks
something like this:

rw_args = (rtems_libio_rw_args_t *) arg;
buffer = rw_args->buffer;
count = rw_args->count;
offset = rw_args->offset;

-- 
  Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  aaron at frye.com
     "In a few thousand years people will be scratching their heads
       wondering how on earth the first computer was invented and
          bootstrapped without a prior computer to do it with."
                    --  Chris Malcolm, on comp.arch



More information about the users mailing list