Determining the name of the file from a resmgr callback

From a resource manager callback, for example,
static int IoWrite( resmgr_context_t* pContext, io_write_t* pMsg,
RESMGR_OCB_T* pOcb);
how do I determine the filename of the file being operated on?

Thanks,
Shaun

Shaun Jackman <sjackman@nospam.vortek.com> wrote:

From a resource manager callback, for example,
static int IoWrite( resmgr_context_t* pContext, io_write_t* pMsg,
RESMGR_OCB_T* pOcb);
how do I determine the filename of the file being operated on?

If the open() handler did its job correctly, then pOcb->attr is the
iofunc_attr_t that was opened, which is all you should need. Names
are irrelevant to an open object (as it may have 0 or 1 or more of
them). If you need it, and can’t deduce it from the attr, then you’d
need to extend either the attr (or the ocb if you wish to handle
links) to contain the name.

John Garvey <jgarvey@qnx.com> wrote:

Shaun Jackman <> sjackman@nospam.vortek.com> > wrote:
From a resource manager callback, for example,
static int IoWrite( resmgr_context_t* pContext, io_write_t* pMsg,
RESMGR_OCB_T* pOcb);
how do I determine the filename of the file being operated on?

If the open() handler did its job correctly, then pOcb->attr is the
iofunc_attr_t that was opened, which is all you should need. Names
are irrelevant to an open object (as it may have 0 or 1 or more of
them). If you need it, and can’t deduce it from the attr, then you’d
need to extend either the attr (or the ocb if you wish to handle
links) to contain the name.

Or, if you do the resmgr_attach() yourself, and one can only open
your mountpoint, (like /dev/ser1, /dev/ser2 …), then the ctp->id
is the id returned by resmgr_attach().

-xtang