Implement CLOCK_MONOTONIC.
This commit is contained in:
parent
e29632c9e1
commit
8f5ef1a9fa
@ -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)));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user