int (*lseek) ( resmgr_context_t *ctp, io_lseek_t *msg, RESMGR_OCB_T *ocb )
struct _io_lseek { uint16_t type; uint16_t combine_len; short whence; uint16_t flags; uint64_t offset; }; typedef union { struct _io_lseek i; uint64_t o; } io_lseek_t;
The only currently defined flag is _IO_LSEEK_IGNORE_NON_SEEKABLE. The client sets this flag if it wants the resource manager to ignore the request if lseek operations aren't supported (for example, an aio_read() on a pipe). In this case, the resource manager shouldn't change the offset.
The default implementation iofunc_lseek_default() and helper function iofunc_iofunc_lseek() do not perform permission checking. They allow the client to adjust the current offset in the OCB even if the file was not opened for reading or writing. It is up to subsequent read and write operations on the OCB to perform all check operations related to the offset.