Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

time(1)

clock_gettimedrift(3)

clock_settimedrift(3)

ctime(3)

timer_gettime(3)

clock_getres(3)  —  Subroutines

Digital

NAME

clock_getres − get the resolution for the specified clock (P1003.4/D10)

SYNOPSIS

#include <timers.h>

int clock_getres (
int clock_id ,
struct timespec ∗res ,
struct timespec ∗maxval) ;

PARAMETERS

clock_id The clock type used to obtain the resolution.  The CLOCK_REALTIME clock is supported and represents the time-of-day clock for the system. 

res A pointer to the timespec data structure that receives the value of the clock’s resolution. 

maxval A pointer to the timespec data structure that receives the clock’s maximum possible time value. 

DESCRIPTION

The clock_getres function returns the resolution value for the specified clock as well as the maximum possible time value. If either res or maxval are NULL, the corresponding value is not returned. These values are the limits that can be used in clock_settime to set the current time. 

RETURN VALUES

On a successful call, a value of 0 is returned. 

On an unsuccessful call, a value of −1 is returned and errno is set to indicate that an error occurred. 

ERRORS

The clock_getres function fails under the following conditions:

[EINVAL] The clock_id argument does not specify a known clock. 

RELATED INFORMATION

time(1), clock_gettimedrift(3), clock_settimedrift(3), ctime(3), timer_gettime(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026