在写资源管理器的时候,一般会用到处理close()来进行一些收尾工作,比如释放内存等等,查看QNX代码resmgr_io_funcs_t结构体对close()的处理有两个相关函数
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);