Default handler for _IO_FDINFO messages


#include <sys/iomgr.h>

int iofunc_fdinfo_default( resmgr_context_t * ctp, 
                  io_fdinfo_t * msg, 
                  iofunc_ocb_t * ocb );


A pointer to the io_fdinfo_t structure that contains the message that the resource manager received; see below.





The iofunc_fdinfo_default() function provides the default handler for the client's iofdinfo() call, which is received as an _IO_FDINFO message by the resource manager.

You can place this function directly into the io_funcs table passed to resmgr_attach() , at the fdinfo position, or you can call iofunc_func_init() to initialize all of the functions to their default values.

The iofunc_fdinfo_default() function calls iofunc_fdinfo() and resmgr_pathname() to do the actual work.

io_fdinfo_t structure

The io_fdinfo_t structure holds the _IO_FDINFO message received by the resource manager:

struct _io_fdinfo {
    uint16_t                    type;
    uint16_t                    combine_len;
    uint32_t                    flags;
    int32_t                     path_len;
    uint32_t                    reserved;

struct _io_fdinfo_reply {
    uint32_t                    zero[2];
    struct _fdinfo              info;
/*  char                        path[path_len + 1];  */

typedef union {
    struct _io_fdinfo           i;
    struct _io_fdinfo_reply     o;
} io_fdinfo_t;


The i member is a structure of type _io_fdinfo that contains the following members:

Specify _FDINFO_FLAG_LOCALPATH to return only the local path info (i.e. exclude the network path info).
The size of the path reply buffers that follow the reply.

The o member is a structure of type _io_fdinfo_reply that contains the following members:

A _fdinfo structure that's defined (in <sys/iomgr.h>) as:
struct _fdinfo {
    uint32_t     mode;   /* File mode */
    uint32_t     ioflag; /* Current io flags */
    uint64_t     offset; /* Current seek position */
    uint64_t     size;   /* Current size of file */
    uint32_t     flags;  /* _FDINFO_* */
    uint16_t     sflag;  /* Share flags */
    uint16_t     count;  /* File use count */
    uint16_t     rcount; /* File reader count */
    uint16_t     wcount; /* File writer count */
    uint16_t     rlocks; /* Number of read locks */
    uint16_t     wlocks; /* Number of write locks */
    uint32_t     zero[6];

The commented-out declaration for path indicates that path_len + 1 bytes of data immediately follow the _io_fdinfo_reply structure.


Success; the resource manager library should return a one-part IOV to the client.
Insufficient space is available in the server's buffer to receive the entire message.


QNX Neutrino

Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes