2 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
30 * Copyright (c) 1982, 1986, 1989, 1993
31 * The Regents of the University of California. All rights reserved.
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
36 * 1. Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright
39 * notice, this list of conditions and the following disclaimer in the
40 * documentation and/or other materials provided with the distribution.
41 * 3. All advertising materials mentioning features or use of this software
42 * must display the following acknowledgement:
43 * This product includes software developed by the University of
44 * California, Berkeley and its contributors.
45 * 4. Neither the name of the University nor the names of its contributors
46 * may be used to endorse or promote products derived from this software
47 * without specific prior written permission.
49 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61 * @(#)kern_time.c 8.4 (Berkeley) 5/26/95
64 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
65 * support for mandatory and extensible security protections. This notice
66 * is included in support of clause 2.2 (b) of the Apple Public License,
70 #include <sys/param.h>
71 #include <sys/resourcevar.h>
72 #include <sys/kernel.h>
73 #include <sys/systm.h>
74 #include <sys/proc_internal.h>
75 #include <sys/kauth.h>
76 #include <sys/vnode.h>
80 #include <sys/mount_internal.h>
81 #include <sys/sysproto.h>
82 #include <sys/signalvar.h>
83 #include <sys/protosw.h> /* for net_uptime2timeval() */
85 #include <kern/clock.h>
86 #include <kern/task.h>
87 #include <kern/thread_call.h>
89 #include <security/mac_framework.h>
91 #include <IOKit/IOBSD.h>
93 #include <kern/remote_time.h>
95 #define HZ 100 /* XXX */
97 /* simple lock used to access timezone, tz structure */
98 static LCK_GRP_DECLARE(tz_slock_grp
, "tzlock");
99 static LCK_SPIN_DECLARE(tz_slock
, &tz_slock_grp
);
101 static void setthetime(
104 static boolean_t
timeval_fixusec(struct timeval
*t1
);
107 * Time of day and interval timer support.
109 * These routines provide the kernel entry points to get and set
110 * the time-of-day and per-process interval timers. Subroutines
111 * here provide support for adding and subtracting timeval structures
112 * and decrementing interval timers, optionally reloading the interval
113 * timers when they expire.
119 struct gettimeofday_args
*uap
,
120 __unused
int32_t *retval
)
123 struct timezone ltz
; /* local copy */
128 if (uap
->tp
|| uap
->mach_absolute_time
) {
129 clock_gettimeofday_and_absolute_time(&secs
, &usecs
, &mach_time
);
133 /* Casting secs through a uint32_t to match arm64 commpage */
134 if (IS_64BIT_PROCESS(p
)) {
135 struct user64_timeval user_atv
= {};
136 user_atv
.tv_sec
= (uint32_t)secs
;
137 user_atv
.tv_usec
= usecs
;
138 error
= copyout(&user_atv
, uap
->tp
, sizeof(user_atv
));
140 struct user32_timeval user_atv
= {};
141 user_atv
.tv_sec
= (uint32_t)secs
;
142 user_atv
.tv_usec
= usecs
;
143 error
= copyout(&user_atv
, uap
->tp
, sizeof(user_atv
));
151 lck_spin_lock(&tz_slock
);
153 lck_spin_unlock(&tz_slock
);
155 error
= copyout((caddr_t
)<z
, CAST_USER_ADDR_T(uap
->tzp
), sizeof(tz
));
158 if (error
== 0 && uap
->mach_absolute_time
) {
159 error
= copyout(&mach_time
, uap
->mach_absolute_time
, sizeof(mach_time
));
166 * XXX Y2038 bug because of setthetime() argument
170 settimeofday(__unused
struct proc
*p
, struct settimeofday_args
*uap
, __unused
int32_t *retval
)
176 bzero(&atv
, sizeof(atv
));
178 /* Check that this task is entitled to set the time or it is root */
179 if (!IOTaskHasEntitlement(current_task(), SETTIME_ENTITLEMENT
)) {
181 error
= mac_system_check_settime(kauth_cred_get());
186 #if defined(XNU_TARGET_OS_OSX)
187 if ((error
= suser(kauth_cred_get(), &p
->p_acflag
))) {
193 /* Verify all parameters before changing time */
195 if (IS_64BIT_PROCESS(p
)) {
196 struct user64_timeval user_atv
;
197 error
= copyin(uap
->tv
, &user_atv
, sizeof(user_atv
));
198 atv
.tv_sec
= (__darwin_time_t
)user_atv
.tv_sec
;
199 atv
.tv_usec
= user_atv
.tv_usec
;
201 struct user32_timeval user_atv
;
202 error
= copyin(uap
->tv
, &user_atv
, sizeof(user_atv
));
203 atv
.tv_sec
= user_atv
.tv_sec
;
204 atv
.tv_usec
= user_atv
.tv_usec
;
210 if (uap
->tzp
&& (error
= copyin(uap
->tzp
, (caddr_t
)&atz
, sizeof(atz
)))) {
214 /* only positive values of sec/usec are accepted */
215 if (atv
.tv_sec
< 0 || atv
.tv_usec
< 0) {
218 if (!timeval_fixusec(&atv
)) {
224 lck_spin_lock(&tz_slock
);
226 lck_spin_unlock(&tz_slock
);
235 clock_set_calendar_microtime(tv
->tv_sec
, tv
->tv_usec
);
239 * Verify the calendar value. If negative,
240 * reset to zero (the epoch).
244 __unused
time_t base
)
250 * The calendar has already been
251 * set up from the platform clock.
253 * The value returned by microtime()
254 * is gotten from the calendar.
258 if (tv
.tv_sec
< 0 || tv
.tv_usec
< 0) {
259 printf("WARNING: preposterous time in Real Time Clock");
260 tv
.tv_sec
= 0; /* the UNIX epoch */
263 printf(" -- CHECK AND RESET THE DATE!\n");
271 clock_nsec_t nanosecs
;
273 clock_get_boottime_nanotime(&secs
, &nanosecs
);
278 boottime_timeval(struct timeval
*tv
)
281 clock_usec_t microsecs
;
283 clock_get_boottime_microtime(&secs
, µsecs
);
286 tv
->tv_usec
= microsecs
;
290 * Get value of an interval timer. The process virtual and
291 * profiling virtual time timers are kept internally in the
292 * way they are specified externally: in time until they expire.
294 * The real time interval timer expiration time (p_rtime)
295 * is kept as an absolute time rather than as a delta, so that
296 * it is easy to keep periodic real-time signals from drifting.
298 * The real time timer is processed by a callout routine.
299 * Since a callout may be delayed in real time due to
300 * other processing in the system, it is possible for the real
301 * time callout routine (realitexpire, given below), to be delayed
302 * in real time past when it is supposed to occur. It does not
303 * suffice, therefore, to reload the real time .it_value from the
304 * real time .it_interval. Rather, we compute the next time in
305 * absolute time when the timer should go off.
308 * EINVAL Invalid argument
309 * copyout:EFAULT Bad address
313 getitimer(struct proc
*p
, struct getitimer_args
*uap
, __unused
int32_t *retval
)
315 struct itimerval aitv
;
317 if (uap
->which
> ITIMER_PROF
) {
321 bzero(&aitv
, sizeof(aitv
));
324 switch (uap
->which
) {
327 * If time for real time timer has passed return 0,
328 * else return difference between current time and
329 * time for the timer to go off.
331 aitv
= p
->p_realtimer
;
332 if (timerisset(&p
->p_rtime
)) {
336 if (timercmp(&p
->p_rtime
, &now
, <)) {
337 timerclear(&aitv
.it_value
);
339 aitv
.it_value
= p
->p_rtime
;
340 timevalsub(&aitv
.it_value
, &now
);
343 timerclear(&aitv
.it_value
);
348 aitv
= p
->p_vtimer_user
;
352 aitv
= p
->p_vtimer_prof
;
358 if (IS_64BIT_PROCESS(p
)) {
359 struct user64_itimerval user_itv
;
360 bzero(&user_itv
, sizeof(user_itv
));
361 user_itv
.it_interval
.tv_sec
= aitv
.it_interval
.tv_sec
;
362 user_itv
.it_interval
.tv_usec
= aitv
.it_interval
.tv_usec
;
363 user_itv
.it_value
.tv_sec
= aitv
.it_value
.tv_sec
;
364 user_itv
.it_value
.tv_usec
= aitv
.it_value
.tv_usec
;
365 return copyout((caddr_t
)&user_itv
, uap
->itv
, sizeof(user_itv
));
367 struct user32_itimerval user_itv
;
368 bzero(&user_itv
, sizeof(user_itv
));
369 user_itv
.it_interval
.tv_sec
= (user32_time_t
)aitv
.it_interval
.tv_sec
;
370 user_itv
.it_interval
.tv_usec
= aitv
.it_interval
.tv_usec
;
371 user_itv
.it_value
.tv_sec
= (user32_time_t
)aitv
.it_value
.tv_sec
;
372 user_itv
.it_value
.tv_usec
= aitv
.it_value
.tv_usec
;
373 return copyout((caddr_t
)&user_itv
, uap
->itv
, sizeof(user_itv
));
379 * EINVAL Invalid argument
380 * copyin:EFAULT Bad address
381 * getitimer:EINVAL Invalid argument
382 * getitimer:EFAULT Bad address
386 setitimer(struct proc
*p
, struct setitimer_args
*uap
, int32_t *retval
)
388 struct itimerval aitv
;
392 bzero(&aitv
, sizeof(aitv
));
394 if (uap
->which
> ITIMER_PROF
) {
397 if ((itvp
= uap
->itv
)) {
398 if (IS_64BIT_PROCESS(p
)) {
399 struct user64_itimerval user_itv
;
400 if ((error
= copyin(itvp
, (caddr_t
)&user_itv
, sizeof(user_itv
)))) {
403 aitv
.it_interval
.tv_sec
= (__darwin_time_t
)user_itv
.it_interval
.tv_sec
;
404 aitv
.it_interval
.tv_usec
= user_itv
.it_interval
.tv_usec
;
405 aitv
.it_value
.tv_sec
= (__darwin_time_t
)user_itv
.it_value
.tv_sec
;
406 aitv
.it_value
.tv_usec
= user_itv
.it_value
.tv_usec
;
408 struct user32_itimerval user_itv
;
409 if ((error
= copyin(itvp
, (caddr_t
)&user_itv
, sizeof(user_itv
)))) {
412 aitv
.it_interval
.tv_sec
= user_itv
.it_interval
.tv_sec
;
413 aitv
.it_interval
.tv_usec
= user_itv
.it_interval
.tv_usec
;
414 aitv
.it_value
.tv_sec
= user_itv
.it_value
.tv_sec
;
415 aitv
.it_value
.tv_usec
= user_itv
.it_value
.tv_usec
;
418 if ((uap
->itv
= uap
->oitv
) && (error
= getitimer(p
, (struct getitimer_args
*)uap
, retval
))) {
424 if (itimerfix(&aitv
.it_value
) || itimerfix(&aitv
.it_interval
)) {
428 switch (uap
->which
) {
431 if (timerisset(&aitv
.it_value
)) {
432 microuptime(&p
->p_rtime
);
433 timevaladd(&p
->p_rtime
, &aitv
.it_value
);
434 p
->p_realtimer
= aitv
;
435 if (!thread_call_enter_delayed_with_leeway(p
->p_rcall
, NULL
,
436 tvtoabstime(&p
->p_rtime
), 0, THREAD_CALL_DELAY_USER_NORMAL
)) {
440 timerclear(&p
->p_rtime
);
441 p
->p_realtimer
= aitv
;
442 if (thread_call_cancel(p
->p_rcall
)) {
452 if (timerisset(&aitv
.it_value
)) {
453 task_vtimer_set(p
->task
, TASK_VTIMER_USER
);
455 task_vtimer_clear(p
->task
, TASK_VTIMER_USER
);
459 p
->p_vtimer_user
= aitv
;
464 if (timerisset(&aitv
.it_value
)) {
465 task_vtimer_set(p
->task
, TASK_VTIMER_PROF
);
467 task_vtimer_clear(p
->task
, TASK_VTIMER_PROF
);
471 p
->p_vtimer_prof
= aitv
;
480 * Real interval timer expired:
481 * send process whose timer expired an alarm signal.
482 * If time is not set up to reload, then just return.
483 * Else compute next time timer should go off which is > current time.
484 * This is where delay in processing this timeout causes multiple
485 * SIGALRM calls to be compressed into one.
494 r
= proc_find(p
->p_pid
);
498 assert(p
->p_ractive
> 0);
500 if (--p
->p_ractive
> 0 || r
!= p
) {
502 * bail, because either proc is exiting
503 * or there's another active thread call
513 if (!timerisset(&p
->p_realtimer
.it_interval
)) {
515 * p_realtimer was cleared while this call was pending,
516 * send one last SIGALRM, but don't re-arm
518 timerclear(&p
->p_rtime
);
529 * Send the signal before re-arming the next thread call,
530 * so in case psignal blocks, we won't create yet another thread call.
537 /* Should we still re-arm the next thread call? */
538 if (!timerisset(&p
->p_realtimer
.it_interval
)) {
539 timerclear(&p
->p_rtime
);
547 timevaladd(&p
->p_rtime
, &p
->p_realtimer
.it_interval
);
549 if (timercmp(&p
->p_rtime
, &t
, <=)) {
550 if ((p
->p_rtime
.tv_sec
+ 2) >= t
.tv_sec
) {
552 timevaladd(&p
->p_rtime
, &p
->p_realtimer
.it_interval
);
553 if (timercmp(&p
->p_rtime
, &t
, >)) {
558 p
->p_rtime
= p
->p_realtimer
.it_interval
;
559 timevaladd(&p
->p_rtime
, &t
);
563 assert(p
->p_rcall
!= NULL
);
565 if (!thread_call_enter_delayed_with_leeway(p
->p_rcall
, NULL
, tvtoabstime(&p
->p_rtime
), 0,
566 THREAD_CALL_DELAY_USER_NORMAL
)) {
576 * Called once in proc_exit to clean up after an armed or pending realitexpire
578 * This will only be called after the proc refcount is drained,
579 * so realitexpire cannot be currently holding a proc ref.
580 * i.e. it will/has gotten PROC_NULL from proc_find.
583 proc_free_realitimer(proc_t p
)
587 assert(p
->p_rcall
!= NULL
);
588 assert(p
->p_refcount
== 0);
590 timerclear(&p
->p_realtimer
.it_interval
);
592 if (thread_call_cancel(p
->p_rcall
)) {
593 assert(p
->p_ractive
> 0);
597 while (p
->p_ractive
> 0) {
605 thread_call_t call
= p
->p_rcall
;
610 thread_call_free(call
);
614 * Check that a proposed value to load into the .it_value or
615 * .it_interval part of an interval timer is acceptable.
621 if (tv
->tv_sec
< 0 || tv
->tv_sec
> 100000000 ||
622 tv
->tv_usec
< 0 || tv
->tv_usec
>= 1000000) {
629 timespec_is_valid(const struct timespec
*ts
)
631 /* The INT32_MAX limit ensures the timespec is safe for clock_*() functions
632 * which accept 32-bit ints. */
633 if (ts
->tv_sec
< 0 || ts
->tv_sec
> INT32_MAX
||
634 ts
->tv_nsec
< 0 || (unsigned long long)ts
->tv_nsec
> NSEC_PER_SEC
) {
641 * Decrement an interval timer by a specified number
642 * of microseconds, which must be less than a second,
643 * i.e. < 1000000. If the timer expires, then reload
644 * it. In this case, carry over (usec - old value) to
645 * reduce the value reloaded into the timer so that
646 * the timer does not drift. This routine assumes
647 * that it is called in a context where the timers
648 * on which it is operating cannot change in value.
652 struct itimerval
*itp
, int usec
)
656 if (itp
->it_value
.tv_usec
< usec
) {
657 if (itp
->it_value
.tv_sec
== 0) {
658 /* expired, and already in next interval */
659 usec
-= itp
->it_value
.tv_usec
;
662 itp
->it_value
.tv_usec
+= 1000000;
663 itp
->it_value
.tv_sec
--;
665 itp
->it_value
.tv_usec
-= usec
;
667 if (timerisset(&itp
->it_value
)) {
671 /* expired, exactly at end of interval */
673 if (timerisset(&itp
->it_interval
)) {
674 itp
->it_value
= itp
->it_interval
;
675 if (itp
->it_value
.tv_sec
> 0) {
676 itp
->it_value
.tv_usec
-= usec
;
677 if (itp
->it_value
.tv_usec
< 0) {
678 itp
->it_value
.tv_usec
+= 1000000;
679 itp
->it_value
.tv_sec
--;
683 itp
->it_value
.tv_usec
= 0; /* sec is already 0 */
690 * Add and subtract routines for timevals.
691 * N.B.: subtract routine doesn't deal with
692 * results which are before the beginning,
693 * it just gets very confused in this case.
701 t1
->tv_sec
+= t2
->tv_sec
;
702 t1
->tv_usec
+= t2
->tv_usec
;
710 t1
->tv_sec
-= t2
->tv_sec
;
711 t1
->tv_usec
-= t2
->tv_usec
;
718 if (t1
->tv_usec
< 0) {
720 t1
->tv_usec
+= 1000000;
722 if (t1
->tv_usec
>= 1000000) {
724 t1
->tv_usec
-= 1000000;
732 assert(t1
->tv_usec
>= 0);
733 assert(t1
->tv_sec
>= 0);
735 if (t1
->tv_usec
>= 1000000) {
736 if (os_add_overflow(t1
->tv_sec
, t1
->tv_usec
/ 1000000, &t1
->tv_sec
)) {
739 t1
->tv_usec
= t1
->tv_usec
% 1000000;
746 * Return the best possible estimate of the time in the timeval
747 * to which tvp points.
754 clock_usec_t tv_usec
;
756 clock_get_calendar_microtime(&tv_sec
, &tv_usec
);
758 tvp
->tv_sec
= tv_sec
;
759 tvp
->tv_usec
= tv_usec
;
763 microtime_with_abstime(
764 struct timeval
*tvp
, uint64_t *abstime
)
767 clock_usec_t tv_usec
;
769 clock_get_calendar_absolute_and_microtime(&tv_sec
, &tv_usec
, abstime
);
771 tvp
->tv_sec
= tv_sec
;
772 tvp
->tv_usec
= tv_usec
;
780 clock_usec_t tv_usec
;
782 clock_get_system_microtime(&tv_sec
, &tv_usec
);
784 tvp
->tv_sec
= tv_sec
;
785 tvp
->tv_usec
= tv_usec
;
789 * Ditto for timespec.
793 struct timespec
*tsp
)
796 clock_nsec_t tv_nsec
;
798 clock_get_calendar_nanotime(&tv_sec
, &tv_nsec
);
800 tsp
->tv_sec
= tv_sec
;
801 tsp
->tv_nsec
= tv_nsec
;
806 struct timespec
*tsp
)
809 clock_nsec_t tv_nsec
;
811 clock_get_system_nanotime(&tv_sec
, &tv_nsec
);
813 tsp
->tv_sec
= tv_sec
;
814 tsp
->tv_nsec
= tv_nsec
;
821 uint64_t result
, usresult
;
823 clock_interval_to_absolutetime_interval(
824 (uint32_t)tvp
->tv_sec
, NSEC_PER_SEC
, &result
);
825 clock_interval_to_absolutetime_interval(
826 tvp
->tv_usec
, NSEC_PER_USEC
, &usresult
);
828 return result
+ usresult
;
832 tstoabstime(struct timespec
*ts
)
834 uint64_t abstime_s
, abstime_ns
;
835 clock_interval_to_absolutetime_interval((uint32_t)ts
->tv_sec
, NSEC_PER_SEC
, &abstime_s
);
836 clock_interval_to_absolutetime_interval((uint32_t)ts
->tv_nsec
, 1, &abstime_ns
);
837 return abstime_s
+ abstime_ns
;
842 * ratecheck(): simple time-based rate-limit checking.
845 ratecheck(struct timeval
*lasttime
, const struct timeval
*mininterval
)
847 struct timeval tv
, delta
;
850 net_uptime2timeval(&tv
);
852 timevalsub(&delta
, lasttime
);
855 * check for 0,0 is so that the message will be seen at least once,
856 * even if interval is huge.
858 if (timevalcmp(&delta
, mininterval
, >=) ||
859 (lasttime
->tv_sec
== 0 && lasttime
->tv_usec
== 0)) {
868 * ppsratecheck(): packets (or events) per second limitation.
871 ppsratecheck(struct timeval
*lasttime
, int *curpps
, int maxpps
)
873 struct timeval tv
, delta
;
876 net_uptime2timeval(&tv
);
878 timersub(&tv
, lasttime
, &delta
);
881 * Check for 0,0 so that the message will be seen at least once.
882 * If more than one second has passed since the last update of
883 * lasttime, reset the counter.
885 * we do increment *curpps even in *curpps < maxpps case, as some may
886 * try to use *curpps for stat purposes as well.
888 if ((lasttime
->tv_sec
== 0 && lasttime
->tv_usec
== 0) ||
893 } else if (maxpps
< 0) {
895 } else if (*curpps
< maxpps
) {
901 #if 1 /* DIAGNOSTIC? */
902 /* be careful about wrap-around */
903 if (*curpps
+ 1 > 0) {
904 *curpps
= *curpps
+ 1;
908 * assume that there's not too many calls to this function.
909 * not sure if the assumption holds, as it depends on *caller's*
910 * behavior, not the behavior of this function.
911 * IMHO it is wrong to make assumption on the caller's behavior,
912 * so the above #if is #if 1, not #ifdef DIAGNOSTIC.
914 *curpps
= *curpps
+ 1;
919 #endif /* NETWORKING */
922 __mach_bridge_remote_time(__unused
struct proc
*p
, struct __mach_bridge_remote_time_args
*mbrt_args
, uint64_t *retval
)
924 *retval
= mach_bridge_remote_time(mbrt_args
->local_timestamp
);