摘要
提取时钟当前状态的所有低级详细信息。
声明
#include <zircon/syscalls.h>
zx_status_t zx_clock_get_details(zx_handle_t handle,
uint64_t options,
void* details);
权限
handle 必须为 ZX_OBJ_TYPE_CLOCK
类型且具有 ZX_RIGHT_READ
。
说明
提取时钟对象的精细详情。如需了解报告的详细信息,请参阅时钟。目前,系统仅为时钟定义了一个详情结构,即 zx_clock_details_v1_t
。用户必须使用 options 参数指定结构的版本,并通过 details
提供至少 sizeof(zx_clock_details_v1_t)
字节的存储空间。例如:
#include <zircon/syscalls.h>
#include <zircon/syscalls/clock.h>
void GetSomeDetails(zx_handle_t the_clock) {
zx_clock_details_v1_t details;
zx_status_t status;
status = zx_clock_get_details(the_clock, ZX_CLOCK_ARGS_VERSION(1), &details);
if (status == ZX_OK) {
// Do great things with our details.
}
}
返回值
如果成功,则返回 ZX_OK
以及存储在 details out 参数中的时钟详细信息。
错误
ZX_ERR_BAD_HANDLE
:handle 是无效的 handle,或者是指向非ZX_OBJ_TYPE_CLOCK
对象类型的 handle。ZX_ERR_ACCESS_DENIED
:句柄缺少ZX_RIGHT_READ
权限。ZX_ERR_INVALID_ARGS
:options
发出的信号的详细信息结构版本无效,或者通过details
传递的结构的指针无效。