Open file descriptor I/O function handler

Prototype:

int (*openfd) ( resmgr_context_t *ctp,
                io_openfd_t *msg,
                RESMGR_OCB_T *ocb ) 

Classification:

I/O

Default handler:

iofunc_openfd_default()

Helper functions:

iofunc_ability_check(), iofunc_openfd()

Client function:

openfd()

Messages:

_IO_OPENFD

Data structure:

struct _io_openfd {
  uint16_t            type;
  uint16_t            combine_len;
  uint32_t            ioflag;
  uint16_t            sflag;
  uint16_t            reserved1;
  struct _msg_info32  info;
  uint32_t            reserved2;
  uint32_t            key;
};

typedef union {
  struct _io_openfd i;
} io_openfd_t;

Description:

This function is similar to the handler provided for the open connect function handler, except that instead of a pathname, an already-open file descriptor is passed (by virtue of passing you the ocb in the function call).

Returns:

The status via the helper macro _RESMGR_STATUS().

Referenced by:

resmgr_io_funcs_t I/O table

Permission checking:

The default implementation iofunc_openfd_default() checks the extended type and then calls the helper function iofunc_openfd. The helper function makes sure that the new permissions are not less restrictive than the access mode that is currently open.