1

I know mach_timebase_info has a return type of kern_return_t, but I'm not able to locate documenation that specifies the possible return values. Where can I find this information?

Coder
  • 441
  • 2
  • 17
  • in` /usr/include/mach/kern_return.h` you could find `kern_return_t` possibles values. To find which of them are implemented in `mach_timebase_info` you could look at source code. – LPs Jul 16 '15 at 09:59

1 Answers1

1

According to the latest source for xnu-2782.1.97 (OS X 10.10.1) available at http://www.opensource.apple.com/release/os-x-10101/, the only return value is KERN_SUCCESS:

/*
 *  mach_timebase_info_trap:
 *
 *  User trap returns timebase constant.
 */
kern_return_t
mach_timebase_info_trap(
    struct mach_timebase_info_trap_args *args)
{
    mach_vm_address_t           out_info_addr = args->info;
    mach_timebase_info_data_t   info;

    clock_timebase_info(&info);

    copyout((void *)&info, out_info_addr, sizeof (info));

    return (KERN_SUCCESS);
}
Coder
  • 441
  • 2
  • 17
  • The same is true all the way back to OS X 10.0 (xnu-123.5). – Coder Jul 16 '15 at 12:30
  • For those coming here now, the files in question are `libsyscall/wrappers/mach_timebase_info.c` and `osfmk/kern/clock.c`, and the answer is still true on 10.12. – andlabs Dec 01 '16 at 02:59