InterruptDetach(), InterruptDetach_r()

Updated: October 28, 2024

Detach an interrupt handler by ID

Synopsis:

#include <sys/neutrino.h>

int InterruptDetach( int id );

int InterruptDetach_r( int id );

Arguments:

id
An interrupt function ID, as returned by InterruptAttach(), InterruptAttachArray(), InterruptAttachEvent(), InterruptHookIdle2(), or InterruptHookTrace().

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The InterruptDetach() and InterruptDetach_r() kernel calls detach the interrupt handler specified by the id argument. These functions are identical except in the way they indicate errors. See the Returns section for details.

Blocking states

These calls don't block.

Returns:

The only difference between these functions is the way they indicate errors:

InterruptDetach()
If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
InterruptDetach_r()
EOK is returned on success. This function does NOT set errno. If an error occurs, any value in the Errors section may be returned.

Errors:

EINVAL
One of the following:
  • The value of id doesn't exist.
  • The id specifies a user-space IST but it is not that IST calling InterruptDetach().
EPERM
The calling thread isn't in the process that attached the handler or event identified by id.
ESRCH
The value of id is not a valid interrupt ID.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes