Default handler for _IO_LOCK messages
#include <sys/iofunc.h> int iofunc_lock_default( resmgr_context_t * ctp, io_lock_t * msg, iofunc_ocb_t * ocb );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The iofunc_lock_default() function implements POSIX semantics for the _IO_LOCK message (generated as a result of a client fcntl() call).
You can place this function directly into the resmgr_io_funcs_t table passed as the io_funcs argument to resmgr_attach(), at the lock position, or you can call iofunc_func_init() to initialize all of the functions to their default values.
The iofunc_lock_default() function verifies that the client has the necessary permissions to effect a lock on the resource. This includes checking for read and write permissions against the type of lock being effected. If so, the lock is performed, modifying elements of the ocb->attr structure, and updating ocb->attr->locklist to reflect the new lock. This function calls iofunc_lock() to do the actual work.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |