int (*lock) ( resmgr_context_t *ctp, io_lock_t *msg, RESMGR_OCB_T *ocb )
struct _io_lock { uint16_t type; uint16_t combine_len; uint32_t subtype; uint32_t nbytes; }; struct _io_lock_reply { uint32_t zero [3]; }; typedef union { struct _io_lock i; struct _io_lock_reply o; } io_lock_t;
The default implementation iofunc_lock_default() calls the helper function iofunc_lock().The helper function ensures that write locks can only be set if you opened the file for writing, read locks can only be set if you opened the file for reading, and exclusive locks can only be set if you opened the file for reading or writing.