Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Dealing with stat() in a res mgr...: (5 Items)
   
Dealing with stat() in a res mgr...  
So I have a resource manager that implements io-open, io-close, and io-stat.  To my understanding (based on qnx's 
website) the stat() function is implemented as a single combined message that causes an open, stat, close (prehaps with 
some ocb locking in there) message to be fed to my ResMgr's io handler functions.

Looking at the example of readblock I noticed that by returning an error from the lseek() handler, would cause the io-
read handler to not be called at all, so my assumption is that this is similar for stat, however I wanted to know if my 
assumption is true.

In my case there are times where I can and will respond to the io-open with a failure, however it seems that my io-stat 
function is still being called, even though it would seem that it shouldn't be.   Is there some special way I need to 
deal with this combined message in my io-open or io-stat routines?

Btw: in the case of an open failure condition i am NOT calling iofunc_open_default(), I am simply returning an errno 
value other than EOK.

Any advice with this issue would be greatly appreciated.

Thanks,

Josh
RE: Dealing with stat() in a res mgr...  
The question is, when you fail the open, "errno value other than EOK",
what exactly you are returning?

The errno returned on an open request, has special meaning to the
client. Try EPERM see if that helps you.

-xtang 

> -----Original Message-----
> From: Josh Schmiedlin [mailto:community-noreply@qnx.com]
> Sent: September 11, 2009 2:27 PM
> To: momentics-community
> Subject: Dealing with stat() in a res mgr...
> 
> So I have a resource manager that implements io-open, io-close, and
io-
> stat.  To my understanding (based on qnx's website) the stat()
function is
> implemented as a single combined message that causes an open, stat,
close
> (prehaps with some ocb locking in there) message to be fed to my
ResMgr's
> io handler functions.
> 
> Looking at the example of readblock I noticed that by returning an
error
> from the lseek() handler, would cause the io-read handler to not be
called
> at all, so my assumption is that this is similar for stat, however I
> wanted to know if my assumption is true.
> 
> In my case there are times where I can and will respond to the io-open
> with a failure, however it seems that my io-stat function is still
being
> called, even though it would seem that it shouldn't be.   Is there
some
> special way I need to deal with this combined message in my io-open or
io-
> stat routines?
> 
> Btw: in the case of an open failure condition i am NOT calling
> iofunc_open_default(), I am simply returning an errno value other than
EOK.
> 
> Any advice with this issue would be greatly appreciated.
> 
> Thanks,
> 
> Josh
> 
> 
> 
> _______________________________________________
> 
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post37827
Re: RE: Dealing with stat() in a res mgr...  
I am currently returning EHOSTDOWN, however I will try EPERM   can you tell me or point me to something that would 
explain what the special meanings for the various open returns are... assuming there is something else other than what 
is listed in the documentation for the open() function on your website.

Thanks,

Josh
Re: RE: Dealing with stat() in a res mgr...  
Scratch that... I don't return EHOSTDOWN but rather...ENOENT	
Re: RE: Dealing with stat() in a res mgr...  
So i changed what I was returning from my io-open handler to be EPERM in any failure case I encounter and my io-stat 
handler is still being called.

Any other ideas?

Thanks,

 Josh