Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - InterruptDetach and EPERM: (3 Items)
   
InterruptDetach and EPERM  
Hi,

I have a test program that takes the interrupt id returned from another process' InterruptAttach and tries 
InterruptDetach with it.

EPERM is returned by InterruptDetach.

In the docs, 
"EPERM The process doesn't have superuser capabilities. "

Can I use an InterruptDetach from a different process? It is allowed? 
If it is not allowed, should the docs note this other reason for an EPERM?

From errno.h,
#define EPERM            1  /* Not owner                                */

ThreadCtl(_NTO_TCTL_IO, 0) returns ok and I can successfully InterruptMask and InterruptUnmask with this same id in my 
test program.

 _NTO_INTR_FLAGS_TRK_MSK | _NTO_INTR_FLAGS_END | _NTO_INTR_FLAGS_PROCESS are passed to InterruptAttach by the first 
process.

thanks,
asherk
RE: InterruptDetach and EPERM  
 

> -----Original Message-----
> From: Andrew Sherk [mailto:community-noreply@qnx.com] 
> Sent: July 23, 2009 4:31 PM
> To: ostech-core_os
> Subject: InterruptDetach and EPERM
> 
> Hi,
> 
> I have a test program that takes the interrupt id returned 
> from another process' InterruptAttach and tries 
> InterruptDetach with it.
> 
> EPERM is returned by InterruptDetach.
> 
> In the docs,
> "EPERM The process doesn't have superuser capabilities. "
> 
> Can I use an InterruptDetach from a different process? It is allowed? 


There's a check in the detach code that makes sure the thread calling
InterruptDetach() belongs to the same process as the thread that called
InterruptAttach().  If that check fails, it returns EPERM.


> If it is not allowed, should the docs note this other reason 
> for an EPERM?

Probably.  Maybe something like this?

EPERM
	The process doesn't have superuser privelages or is not the
process that attached the interrupt identified by _id_.

> 
> thanks,
> asherk
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post34464
> 
> 
RE: InterruptDetach and EPERM  
Thanks, Dave, for your feedback.
PR 70642 has been opened.

> > I have a test program that takes the interrupt id returned from 
> > another process' InterruptAttach and tries InterruptDetach with it.
> > 
> > EPERM is returned by InterruptDetach.
> > 
> > In the docs,
> > "EPERM The process doesn't have superuser capabilities. "
> > 
> > Can I use an InterruptDetach from a different process? It 
> is allowed? 
> 
> 
> There's a check in the detach code that makes sure the thread calling
> InterruptDetach() belongs to the same process as the thread 
> that called InterruptAttach().  If that check fails, it returns EPERM.
> 
> 
> > If it is not allowed, should the docs note this other reason for an 
> > EPERM?
> 
> Probably.  Maybe something like this?
> 
> EPERM
> 	The process doesn't have superuser privelages or is not 
> the process that attached the interrupt identified by _id_.