Detach an interrupt handler by ID
#include <sys/neutrino.h> int InterruptDetach( int id ); int InterruptDetach_r( int id );
Use the -l c option to qcc to link against this library. This library is usually included automatically.
These kernel calls detach the interrupt handler specified by the id argument. If, after detaching, no thread is attached to the interrupt, then the interrupt is masked off. The thread that detaches the interrupt handler must be in the same process as the thread that attached it.
The InterruptDetach() and InterruptDetach_r() functions are identical except in the way they indicate errors. See the Returns section for details.
Before calling either of these functions, the thread must:
- have the PROCMGR_AID_IO ability enabled. For more information, see procmgr_ability() .
- request I/O privileges by calling:
ThreadCtl( _NTO_TCTL_IO, 0 );
If the thread doesn't do these things, it might SIGSEGV when it calls InterruptDetach() or InterruptDetach_r().
These calls don't block.
The only difference between these functions is the way they indicate errors:
- If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
- EOK is returned on success. This function does NOT set errno. If an error occurs, any value in the Errors section may be returned.
- The value of id doesn't exist for this process.
- The process doesn't have superuser privileges, or isn't the process that attached the interrupt identified by id.
Last modified: 2013-12-23