7 int adjtime(const struct timeval
*in
, struct timeval
*out
)
9 struct timex tx
= { 0 };
11 if (in
->tv_sec
> 1000 || in
->tv_usec
> 1000000000) {
15 tx
.offset
= in
->tv_sec
*1000000 + in
->tv_usec
;
16 tx
.modes
= ADJ_OFFSET_SINGLESHOT
;
18 if (adjtimex(&tx
) < 0) return -1;
20 out
->tv_sec
= tx
.offset
/ 1000000;
21 if ((out
->tv_usec
= tx
.offset
% 1000000) < 0) {
23 out
->tv_usec
+= 1000000;