int io_close_dup (resmgr_context_t * ctp , io_close_t * msg , RESMGR_OCB_T * ocb )

Classification: I/O function

Default handler: iofunc_close_dup_default()

Helper functions: iofunc_close_dup()

Client functions: close(), fclose()

Messages: _IO_CLOSE_DUP

Data structure:

struct _io_close {
  uint16_t type;
  uint16_t combine_len;

typedef union {
  struct _io_close i;
} io_close_t;

Description: This is the real function handler for the client's close() or fclose() function calls. Note that you'd almost never take over this function; you'd leave it as iofunc_close_dup_default() in the I/O table. This is because the base layer keeps track of the number of open(), dup() and close() messages issued for a particular OCB, and will then synthesize an io_close_ocb() outcall (see below) when the last close() message has been received for a particular OCB. Note that the receive IDs present in ctp->rcvid may not necessarily match up with those passed to io_open(). However, it's guaranteed that at least one receive ID will match the receive ID from the io_open() function. The "extra" receive IDs are the result of (possibly internal) dup()-type functionality.

Returns: The status via the helper macro _RESMGR_STATUS.