![]() |
![]() |
![]() |
Release Open Control Block resources
#include <sys/iofunc.h> int iofunc_ocb_detach( resmgr_context_t * ctp, iofunc_ocb_t * ocb );
libc
The iofunc_ocb_detach() function releases any resources allocated to the passed ocb, such as any memory map (mmap) entries. It also updates the time structure via iofunc_time_update(), and decrements the read, write, lock, and use counters, according to the mode that was used to open the resource (from ocb->ioflag).
This function is called by iofunc_close_ocb(). This function doesn't free the memory associated with the OCB itself.
The return from iofunc_ocb_detach() is a bitwise OR of flags (see below) describing the state of the managed resource. The counters are incremented in iofunc_ocb_attach(), and represent the number of OCBs that are using the managed resource in the respective manners (e.g.: ocb->attr->rcount keeps count of how many OCBs are using the resource specified by attr for read access).
If you're are using the iofunc_mmap() or iofunc_mmap_default(), you must call this function to clean up. This function is called automatically by iofunc_close_dup().
The return value is a bitwise OR of flags, indicating (if set):
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
iofunc_close_dup(), iofunc_close_ocb(), iofunc_close_ocb_default(), iofunc_ocb_attach()
![]() |
![]() |
![]() |