Get the interrupt handlers owned by the process associated with the file descriptor.

Call this the first time with an argument of NULL to get the number of interrupt handlers:

devctl( fd, DCMD_PROC_IRQS, NULL, 0, &n);

Next, allocate a buffer that's large enough to hold a procfs_irq structure (see debug_irq_t in <sys/debug.h>) for each handler, and pass it to another devctl() call:

my_buffer = (procfs_irq *) malloc( sizeof(procfs_irq) * n );
if ( my_buffer == NULL ) {
  /* Not enough memory. */

devctl( fd, DCMD_PROC_IRQS, my_buffer, sizeof(procfs_irq) * n,