mach_timebase_info的可能返回值是多少?

时间:2015-07-16 09:34:21

标签: c macos xnu

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

1 个答案:

答案 0 :(得分: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);
}