10 __weak_alias(adjtime
, __adjtime50
);
13 int adjtime(const struct timeval
*delta
, struct timeval
*olddelta
)
17 memset(&m
, 0, sizeof(m
));
18 m
.m_lc_pm_time
.clk_id
= CLOCK_REALTIME
;
19 m
.m_lc_pm_time
.now
= 0; /* use adjtime() method to slowly adjust the clock. */
20 m
.m_lc_pm_time
.sec
= delta
->tv_sec
;
21 m
.m_lc_pm_time
.nsec
= delta
->tv_usec
* 1000; /* convert usec to nsec */
23 if (_syscall(PM_PROC_NR
, PM_CLOCK_SETTIME
, &m
) < 0)
26 if (olddelta
!= NULL
) {
27 /* the kernel returns immediately and the adjustment happens in the
28 * background. Also, any currently running adjustment is stopped by
29 * another call to adjtime(2), so the only values possible on Minix
30 * for olddelta are those of delta.
32 olddelta
->tv_sec
= delta
->tv_sec
;
33 olddelta
->tv_usec
= delta
->tv_usec
;