> Sorry, i still don't understand this.
>
> If i do a normal read() on a Trivfs translator, trivfs_S_io_read in my
> translator gets called. OK. But, in the read() call, i haven't
> specified a datalen. Now, at which point does this datalen parameter
> get "created"?
>
> I guess, it's a quiet silly question. I just don't understand yet how
> all these things interact with each other..
You fill it in based on the amount _actually_ read. For instance, amount
is 1024, the file size is 4096 there are 256 bytes until the end of file.
You would:
if (po->pos + amount > po->filesize)
amount = po->filesize - po->pos;
memcpy (data, file_buffer + po->pos, amount);
*datalen = amount;
-Neal
PGP signature