On Tue Feb 4 22:01:19 2025 +0000, Tim Clem wrote:
I have a slight concern with using internals like __commpage_gettimeofday, but it has been in the released xnu source since at least 10.12, and it was [used by qemu when they had separate darwin support](https://github.com/qemu/qemu/blob/1c8a881daaca6fe0646a425b0970fb3ad25f6732/d...) way back in 2011, so it was presumably around even for 10.6/10.7. So, given the performance impact, I'm in support.
I was thinking about that too, but came to the conclusion that it is probably fine for the foreseeable future, given that Apple rewrote that part already once and it looks like so:
``` __attribute__((visibility("hidden"))) int __commpage_gettimeofday_internal(struct timeval *tp, uint64_t *tbr_out);
int __commpage_gettimeofday(struct timeval *tp) { return __commpage_gettimeofday_internal(tp, NULL); } ```
Since this is used a bunch directly by their projects (and a few external ones), they were probably motivated to keep the API stable and not break it then. My assumption is that will also hold for the future.