Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - rename() callout and _IO_CONNECT_RENAME message: (1 Item)
   
rename() callout and _IO_CONNECT_RENAME message  
I am implementing a resource manager for my mount point (a specific location in the file system). And I have added my 
callout functions for open, stat, rename among other functions as follows:

resmgr_connect_funcs_t  connect_funcs;

connect_funcs.open = io_open;
connect_funcs.rename = io_rename;

The empirical observations is that my io_open() callout does get called even for a "rename()" call issued by client 
programs, with the various values as:

int io_open (resmgr_context_t *ctp, io_open_t *msg, RESMGR_HANDLE_T *handle, void *extra)
{
msg->connect.path --> the name of the file that the client program wants to rename
msg->connect.type --> the type with value of 256
msg->connect.subtype --> the subtype with value of 1 (corresponds to _IO_CONNECT_COMBINE_CLOSE in iomsg.h)
}

After the call to io_open() callout, the io_rename() callout gets called with (some of) the various values as below:

int io_rename(resmgr_context_t *ctp, io_rename_t *msg, RESMGR_HANDLE_T *handle, io_rename_extra_t *extra)
{
msg->connect.subtype --> the subtype with value of 4 (corresponds to _IO_CONNECT_RENAME in iomsg.h)
}

Q1) The doc - "QNX Neutrino RTOS - Writing a Resource Manager" mentions that "rename" is a one-shot event. In other 
words, I should not expect my io_open to be called, but instead I should expect my io_rename() to be directly called for
 a rename() issued by the client program. Is this accurate? Should my io_open() callout be getting invoked when a client
 program issues a rename() call?

Q2) In my io_rename(), I do some simple checks and then I want the "default" resource manager (in the case of an x86 VM,
 devb-eide) to be called, so I return _RESMGR_DEFAULT from io_rename(). However, it turns out that the file is not 
renamed and the client program gets an errno of 18. What do I return from the io_rename() so that it goes to devb-eide 
for the actual renaming?