Implement CLOCK_MONOTONIC.

This commit is contained in:
Poul-Henning Kamp 2003-02-23 10:18:31 +00:00
parent e29632c9e1
commit 8f5ef1a9fa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111300
2 changed files with 4 additions and 2 deletions

View file

@ -160,8 +160,9 @@ clock_gettime(struct thread *td, struct clock_gettime_args *uap)
struct timespec ats;
if (uap->clock_id != CLOCK_REALTIME)
return (EINVAL);
nanotime(&ats);
nanotime(&ats);
else if (uap->clock_id != CLOCK_MONOTONIC)
nanouptime(&ats);
return (copyout(&ats, uap->tp, sizeof(ats)));
}

View file

@ -243,6 +243,7 @@ struct clockinfo {
#endif
#define CLOCK_VIRTUAL 1
#define CLOCK_PROF 2
#define CLOCK_MONOTONIC 4
#define TIMER_RELTIME 0x0 /* relative timer */
#ifndef TIMER_ABSTIME