hirestmode(2)
NAME
hirestmode − get/set system timing mode for high resolution timing facility
SYNOPSIS
int hirestmode (mode)
int mode
DESCRIPTION
hirestmode gets or sets the system timing mode for the high resolution timing facility, as specified in mode.
Mode is the flag that determines whether to set or get the system timing mode. The values for mode perform three different tasks:
[<0] Get current system timing mode.
[0] Set system timing mode to exclude interrupt time.
[>0] Set system timing mode to include interrupt time.
When interrupt time is included, a process’ user and system times will total the elapsed time which accrues when the process is the currently running process, including all time spent servicing interrupts. The time spent servicing interrupts is added to the process’ system time. The time spent switching to a new process is added to the new process’ system time.
When excluding interrupt time, a process’ user and system times will total the time which accrues when the process is the currently running process, excluding all time spent servicing interrupts. The time spent switching to a new process is added to the new process’ system time.
hirestmode will fail if one or more of the following are true:
[ENOSYS] High resolution timing facility is not configured into the currently executing kernel.
[EACCES] The calling process tried to set the system timing mode and the user-id of the calling process is not that of the super-user or the user does not have the ACC_HIRESTMODE access vector (if access vectors are configured).
RETURN VALUE
Upon successful completion from a get mode call, the current system timing mode is returned. Upon successful completion from a set mode call, the previous system timing mode is returned. A value of 0 indicates excluding interrupt time and a value of 1 indicates including interrupt time. If an error occurred, a value of −1 is returned and errno is set to indicate the error.
SEE ALSO
CX/UX Programmer’s Guide.
pmqrytimer(3C), pmselect(3C), pmqrytimer(3F), pmselect(3F).
CX/UX Programmer’s Reference Manual