Increment count and locking flags
#include <sys/iofunc.h>
int iofunc_openfd( resmgr_context_t *ctp,
                   io_openfd_t *msg,
                   iofunc_ocb_t *ocb,
                   iofunc_attr_t *attr );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The iofunc_openfd() helper function examines the mode specified by the _IO_OPENFD message, and increments the read and write count flags (ocb->attr->rcount and ocb->attr->wcount), and the locking flags (ocb->attr->rlocks and ocb->attr->wlocks), as specified by the open mode.
The function does what's needed to support the openfd() function.
The io_openfd_t structure holds the _IO_OPENFD message received by the resource manager:
struct _io_openfd {
    uint16_t                    type;
    uint16_t                    combine_len;
    uint32_t                    ioflag;
    uint16_t                    sflag;
    uint16_t                    xtype;
    struct _msg_info            info;
    uint32_t                    reserved2;
    uint32_t                    key;
};
typedef union {
    struct _io_openfd           i;
} io_openfd_t;
The I/O message structures are unions of an input message (coming to the resource manager) and an output or reply message (going back to the client). In this case, there's only an input message, i.
The i member is a structure of type _io_openfd that contains the following members:
The following are for special purposes, and your resource manager probably doesn't need to handle them:
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | Yes | 
| Thread | Yes | 
iofunc_ocb_attach(), iofunc_openfd_default(), _msg_info, openfd()
Resource Managers chapter of Getting Started with QNX Neutrino