Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - open a device from the same process?: (3 Items)
   
open a device from the same process?  
Hello,

I am trying to unit test a simple resource manager.  The unit test process creates the resource manager just fine and I 
can see it registered in /dev/mydevice.

However, when I try to use open to access the device "/dev/mydevice" after creation, I get an error saying no such file 
or directory.

Is it not possible to open a device from the same process that created it?

If I move the resource manager code and start it as a separate process in the system, everything works fine.

Thoughts,

Thanks,
Mike

Re: open a device from the same process?  
On Thu, Oct 30, 2008 at 01:31:37PM -0400, Michael Cranston wrote:
> Hello,
> 
> I am trying to unit test a simple resource manager.  The unit test process creates the resource manager just fine and 
I can see it registered in /dev/mydevice.
> 
> However, when I try to use open to access the device "/dev/mydevice" after creation, I get an error saying no such 
file or directory.
> 
> Is it not possible to open a device from the same process that created it?
> 
> If I move the resource manager code and start it as a separate process in the system, everything works fine.
> 
> Thoughts,

Look at the _RESMGR_FLAG_SELF flag in resmgr_attach().

-seanb
Re: open a device from the same process?  
Thanks.  That did the trick.
Not sure how I missed that in the manual......