Implement CLOCK_MONOTONIC.

This commit is contained in:
Poul-Henning Kamp 2003-02-23 10:18:31 +00:00
parent e29632c9e1
commit 8f5ef1a9fa
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