resmgr_io_funcs_t

Table of POSIX-level I/O functions

Synopsis:

#include <sys/resmgr.h>

typedef struct _resmgr_io_funcs {
   unsigned nfuncs;
   int (*read)      (resmgr_context_t *ctp, io_read_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*write)     (resmgr_context_t *ctp, io_write_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*close_ocb) (resmgr_context_t *ctp, void *reserved,
                     RESMGR_OCB_T *ocb);
   int (*stat)      (resmgr_context_t *ctp, io_stat_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*notify)    (resmgr_context_t *ctp, io_notify_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*devctl)    (resmgr_context_t *ctp, io_devctl_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*unblock)   (resmgr_context_t *ctp, io_pulse_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*pathconf)  (resmgr_context_t *ctp, io_pathconf_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*lseek)     (resmgr_context_t *ctp, io_lseek_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*chmod)     (resmgr_context_t *ctp, io_chmod_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*chown)     (resmgr_context_t *ctp, io_chown_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*utime)     (resmgr_context_t *ctp, io_utime_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*openfd)    (resmgr_context_t *ctp, io_openfd_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*fdinfo)    (resmgr_context_t *ctp, io_fdinfo_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*lock)      (resmgr_context_t *ctp, io_lock_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*space)     (resmgr_context_t *ctp, io_space_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*shutdown)  (resmgr_context_t *ctp, io_shutdown_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*mmap)      (resmgr_context_t *ctp, io_mmap_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*msg)       (resmgr_context_t *ctp, io_msg_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*reserved)  (resmgr_context_t *ctp, void *msg,
                     RESMGR_OCB_T *ocb);
   int (*dup)       (resmgr_context_t *ctp, io_dup_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*close_dup) (resmgr_context_t *ctp, io_close_t *msg,
                     RESMGR_OCB_T *ocb);
   int (*lock_ocb)  (resmgr_context_t *ctp, void *reserved,
                     RESMGR_OCB_T *ocb);
   int (*unlock_ocb)(resmgr_context_t *ctp, void *reserved,
                     RESMGR_OCB_T *ocb);
   int (*sync)      (resmgr_context_t *ctp, io_sync_t *msg,
                     RESMGR_OCB_T *ocb);
} resmgr_io_funcs_t;

Description:

The resmgr_connect_funcs_t structure is a table of the POSIX-level I/O functions that are used by a resource manager. You can initialize this table by calling iofunc_func_init() and then overriding the defaults with your own functions.

This structure includes nfuncs, which indicates how many functions are in the table (in case the structure grows in the future), along with these functions:

Member: Used to: Default:
read Handle _IO_READ messages iofunc_read_default()
write Handle _IO_WRITE messages iofunc_write_default()
close_ocb Return the memory allocated for an OCB iofunc_close_ocb_default()
stat Handle _IO_STAT messages iofunc_stat_default()
notify Handle _IO_NOTIFY messages None
devctl Handle _IO_DEVCTL messages iofunc_devctl_default()
unblock Unblock the resource if an operation is aborted iofunc_unblock_default()
pathconf Handle _IO_PATHCONF messages iofunc_pathconf_default()
lseek Handle _IO_LSEEK messages iofunc_lseek_default()
chmod Handle _IO_CHMOD messages iofunc_chmod_default()
chown Handle _IO_CHOWN messages iofunc_chown_default()
utime Handle _IO_UTIME messages iofunc_utime_default()
openfd Handle _IO_OPENFD messages iofunc_openfd_default()
fdinfo Handle _IO_FDINFO messages iofunc_fdinfo_default()
lock Handle _IO_LOCK messages iofunc_lock_default()
space Allocate or free memory for the resource. None
shutdown Reserved None
mmap Handle _IO_MMAP messages iofunc_mmap_default()
msg Handle a more general messaging scheme to control the device None
reserved Not applicable None
dup Handle _IO_DUP messages None — handled by the base layer
close_dup Handle _IO_CLOSE messages iofunc_close_dup_default()
lock_ocb Lock the attributes for a group of messages iofunc_lock_ocb_default()
unlock_ocb Unlock the attributes for a group of messages iofunc_unlock_ocb_default()
sync Handle _IO_SYNC messages iofunc_sync_default()

Note: If you use iofunc_lock_default(), you must also use iofunc_close_dup_default() and iofunc_unblock_default().

Classification:

QNX Neutrino

See also:

iofunc_chmod_default(), iofunc_chown_default(), iofunc_close_dup_default(), iofunc_close_ocb_default(), iofunc_devctl_default(), iofunc_fdinfo_default(), iofunc_func_init(), iofunc_lock_default(), iofunc_lock_ocb_default(), iofunc_lseek_default(), iofunc_mmap_default(), iofunc_openfd_default(), iofunc_pathconf_default(), iofunc_read_default(), iofunc_stat_default(), iofunc_sync_default(), iofunc_unblock_default(), iofunc_unlock_ocb_default(), iofunc_utime_default(), iofunc_write_default(), resmgr_connect_funcs_t

Writing a Resource Manager

Resource Managers chapter of Getting Started with QNX Neutrino