InterruptHookTrace
![]() |
![]() |
![]() |
![]() |
InterruptHookTrace()
Attach the pseudo interrupt handler that's used by the instrumented module
Synopsis:
#include <sys/neutrino.h> int InterruptHookTrace( const struct sigevent * (* handler)(int), unsigned flags );
Library:
libc
Description:
The InterruptHookTrace() function attaches the pseudo interrupt handler handler which is used by the instrumented module.
Before calling this function, the thread must request I/O privileges by calling:
ThreadCtl( _NTO_TCTL_IO, 0 );
The handler argument specifies the pseudo interrupt handler that receives trace events from the kernel.
The flags argument is a bitwise OR of the following values, or 0:
| Flag | Description |
|---|---|
| _NTO_INTR_FLAGS_END | Put the new handler at the end of the list of existing handlers (for shared interrupts) instead of the start. |
_NTO_INTR_FLAGS_END
The interrupt structure allows trace interrupts to be shared. For example, if two processes take over the same trace interrupt, both handlers are invoked consecutively. When a handler attaches, it's placed in front of any existing handlers for that interrupt and is called first. This behavior can be changed by setting the _NTO_INTR_FLAGS_END flag in the flags argument. This adds the handler at the end of any existing handlers.
Blocking states
This call doesn't block.
Returns:
An interrupt function ID, or -1 if an error occurs (errno is set).
Errors:
- EAGAIN
- All kernel interrupt entries are in use.
- EFAULT
- A fault occurred when the kernel tried to access the buffers provided.
- EPERM
- The process doesn't have superuser capabilities.
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
See also:
![]() |
![]() |
![]() |
![]() |
![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)