DCMD_PROC_TIMERS

Get the timers owned by the process associated with the file descriptor.

#include <sys/procfs.h>

#define DCMD_PROC_TIMERS32  (__DIOF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 23, procfs_timer32))
#define DCMD_PROC_TIMERS64  (__DIOF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 23, procfs_timer64))
#define DCMD_PROC_TIMERS    (__DIOF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 23, procfs_timer))
Note: The generic command maps onto the 64-bit version, unless you're compiling for a 32-bit architecture and you define WANT_OLD_DEVCTLS before you include <sys/procfs.h>.

The arguments to devctl() are:

Argument Value
filedes A file descriptor for the process.
dcmd DCMD_PROC_TIMERS
dev_data_ptr NULL, or an array of procfs_timer structures
n_bytes 0, or the size of the array
dev_info_ptr A pointer to an integer where the number of timers can be stored

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 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);

The procfs_timer structure is the same as the debug_timer_t structure, which is defined for 64-bit architectures as follows in <sys/debug.h>:

typedef struct _debug_timer64 {
  timer_t               id;
  unsigned              spare;
  struct _timer_info32  __info;
  struct _timer_info64  info;
} debug_timer64_t;

For information about the _timer_info structure, see the entry for TimerInfo() in the QNX Neutrino C Library Reference, and the section on DCMD_PROC_INFO in the appendix about the /procfs filesystem in The QNX Neutrino Cookbook.