procmgr_timer_tolerance()

Updated: May 06, 2022

Get or set the default timer tolerance for a process

Synopsis:

#include <sys/procmgr.h>

int procmgr_timer_tolerance( const pid_t pid,
                             const uint64_t * const ntime,
                             uint64_t *otime );

Arguments:

pid
The process ID of the process whose default timer tolerance you want to set, or 0 to set it for the calling process.
ntime
NULL, or the default timer tolerance, in nanoseconds. Specify a large value (e.g., ~0ULL) for infinite tolerance.
otime
NULL, or a pointer to a location where the function can store the current or previous timer tolerance.

Library:

libc

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

Description:

The procmgr_timer_tolerance() function sets or gets the default timer tolerance for a process. This tolerance is used when calculating timer tolerance if the timer has neither a specific tolerance nor the TIMER_PRECISE flag set. This includes the implicit timer used for TimerTimeout() operations.

In order to set the default tolerance of another process, the calling process must have the PROCMGR_AID_DEFAULT_TIMER_TOLERANCE ability enabled. For more information, see procmgr_ability().

The default timer tolerance is inherited across a fork(), but not an exec*() or a spawn*().

Returns:

0 on success, or -1 if an error occurred (errno is set).

Errors:

EPERM
Insufficient permission.
ESRCH
There's no process with the specified process ID.

Classification:

QNX Neutrino

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