mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 15:40:44 +00:00
Implement CLOCK_MONOTONIC.
This commit is contained in:
parent
e29632c9e1
commit
8f5ef1a9fa
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111300
|
@ -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 a new issue