int io_lseek ( resmgr_context_t *ctp, io_lseek_t *msg, RESMGR_OCB_T *ocb )
Classification: I/O
Default handler: iofunc_lseek_default()
Helper functions: iofunc_lseek()
Client functions: lseek(), fseek(), rewinddir()
Messages: _IO_LSEEK
Data structure:
struct _io_lseek { uint16_t type; uint16_t combine_len; short whence; uint16_t zero; uint64_t offset; }; typedef union { struct _io_lseek i; uint64_t o; } io_lseek_t;
Description: Handles the client's lseek() function. Note that a resource manager that handles directories will also need to interpret the _IO_LSEEK message for directory operations. The whence and offset parameters are passed from the client's lseek() function. The routine should adjust the OCB's offset parameter after interpreting the whence and offset parameters from the message and should return the new offset or an error.
Returns: The status via the helper macro _RESMGR_STATUS(), and optionally (if no error and if not part of a combine message) the current offset.