iofunc_fdinfo()

Handle an _IO_FDINFO message

Synopsis:

#include <sys/iofunc.h>

int iofunc_fdinfo( resmgr_context_t * ctp, 
                   iofunc_ocb_t * ocb,
                   iofunc_attr_t * attr,
                   struct _fdinfo * info );

Arguments:

ctp
A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions.
ocb
A pointer to the iofunc_ocb_t structure for the Open Control Block that was created when the client opened the resource.
attr
NULL, or a pointer to the iofunc_attr_t structure that describes the characteristics of the device that's associated with your resource manager.
info
A pointer to a _fdinfo structure that the function fills with the information. This structure is 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 _fdinfo structure is included in the reply part of a io_fdinfo_t structure; for more information, see the documentation for iofunc_fdinfo_default().

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

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

The iofunc_fdinfo() function transfers the appropriate fields from the ocb and attr structures to the info structure. If attr is NULL, then the attr information comes from the structure pointed to by ocb->attr.

Returns:

EOK
Successful completion.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

iofdinfo(), iofunc_attr_t, iofunc_fdinfo_default(), iofunc_ocb_t, resmgr_context_t, resmgr_pathname()

Writing a Resource Manager

Resource Managers chapter of Getting Started with QNX Neutrino