1

我知道 mach_timebase_info 的返回类型为 kern_return_t,但我无法找到指定可能返回值的文档。我在哪里可以找到这些信息?

4

1 回答 1

1

根据http://www.opensource.apple.com/release/os-x-10101/提供的 xnu-2782.1.97 (OS X 10.10.1) 的最新源,唯一的返回值是 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);
}
于 2015-07-16T12:27:31.633 回答