io_stat()

int io_stat ( resmgr_context_t *ctp,
              io_stat_t *msg,
              RESMGR_OCB_T *ocb ) 

Classification: I/O

Default handler: iofunc_stat_default()

Helper functions: iofunc_stat(), iofunc_stat_format()

Client functions: stat(), lstat(), fstat()

Messages: _IO_STAT

Data structure:

struct _io_stat {
    uint16_t                    type;
    uint16_t                    combine_len;
    union {
       uint32_t                 zero;
       uint32_t                 format;
    };
};

typedef union {
    struct _io_stat             i;
    struct __stat_t32_2001      o_t32_2001;
    struct __stat_t32_2008      o_t32_2008;
    struct __stat_t64_2008      o_t64_2008;
    struct stat                 o;
} io_stat_t;

Description: Handles the message that requests information about the resource associated with the passed OCB. Note that the attributes structure contains all the information required to fulfill the stat() request; the helper function iofunc_stat_format() fills a struct stat structure based on the attributes structure. Also, the helper function modifies the stored dev/rdev members to be unique from a single node's point of view (useful for performing stat() calls to files over a network). There's almost no reason to write your own handler for this function.

Returns: The format of the information via the helper macro _RESMGR_STATUS(), and the struct stat via message reply.