Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to pass starting offset to read() and write()?: (2 Items)
   
How to pass starting offset to read() and write()?  
Hello all,

I need to make a device driver (resource manager) that supports
read and write operations at random offsets.

From the sample code in the docum, it looks that read and write requests can contain the offsets. Can anybody tell me 
please, what API allows to pass the offset? Normal read() and write() do not. aio_xxx functions can pass the offset, but
 the library manual says that these are not supported (my target is 6.3.2, by the way).

I want to avoid seek() before every read or write, because this will be a separate message exchange with the resource 
manager, correct? 

As alternative, I could use devctlv() with two iovec's, one of which will contain the offset. But devctlv is 
undocumented (?) and I am not sure how to handle it on the server side.

Thanks for any idea,
- S.
Re: How to pass starting offset to read() and write()?  
you have to use pread()
go ahead to the library reference for more details.

/hp