Get the timers owned by the process associated with the file descriptor.
Call this the first time with an argument of NULL to get the number of timers:
devctl( fd, DCMD_PROC_TIMERS, NULL, 0, &n);
Next, allocate a buffer that's large enough to hold a procfs_timer structure (see debug_timer_t in <sys/debug.h>) for each timer, and pass it to another devctl() call:
my_buffer = (procfs_timer *) malloc( sizeof(procfs_timer) * n; if ( my_buffer == NULL ) { /* Not enough memory. */ } devctl( fd, DCMD_PROC_TIMERS, my_buffer, sizeof(procfs_timer) * n, &dummy);