Since sysctlbyname is not guaranteed to be thread-safe.
Huh? It’s thread-safe. (See below.)
Anyway, what are you actually trying to do? It sounds like you’re trying to get the system boot time without using the functions in the “required reasons” list. I don’t think that’s going to end well.
Quinn wrote:
Some APIs are atomic, that is, they can be called from any thread at any time but they
are still subject to races. Your sysctlbyname case is a good example of this because, in
the case of a read/write value, you might race with the folks setting that value.
I disagree that his sysctl case is a good example of this, because he’s trying to read the boot time, and nothing is writing that while you’re reading it, is it? Have I missed something?