Updated: April 19, 2023 |
Initialize an Open Control Block
#include <sys/iofunc.h> int iofunc_ocb_attach( resmgr_context_t * ctp, io_open_t * msg, iofunc_ocb_t * ocb, iofunc_attr_t * attr, const resmgr_io_funcs_t * io_funcs );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The iofunc_ocb_attach() function examines the mode specified by the io_open msg, and increments the read and write count flags (ocb->attr->rcount and ocb->attr->wcount), and the locking flags (ocb->attr->rlocks and ocb->attr->wlocks), as specified by the open mode. This function then calls resmgr_open_bind() to bind the newly created OCB to the request.
The iofunc_ocb_attach() function is called by iofunc_open_default() as part of its initialization.
This function allocates the memory for the OCB if you pass NULL as the ocb.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |