Skip to content

Latest commit

 

History

History
70 lines (43 loc) · 1.98 KB

debuglog_write.md

File metadata and controls

70 lines (43 loc) · 1.98 KB

zx_debuglog_write

SUMMARY

Write a message to the kernel debuglog.

DECLARATION

#include <zircon/syscalls.h>

zx_status_t zx_debuglog_write(zx_handle_t handle,
                              uint32_t options,
                              const void* buffer,
                              size_t buffer_size);

DESCRIPTION

zx_debuglog_write() attempts to write buffer of size buffer_size bytes to the kernel debuglog. The log entry is written at severity ZX_LOG_INFO.

buffer does not strictly require any particular format, but most userspace tooling assumes the contents will be a valid UTF-8 string without any NUL-termination. buffer will be truncated to some size less than ZX_LOG_RECORD_MAX so that it may fit in the data field of zx_log_record_t.

options must be set to 0.

RIGHTS

handle must be of type ZX_OBJ_TYPE_LOG and have ZX_RIGHT_WRITE.

RETURN VALUE

zx_debuglog_read() returns ZX_OK on success. In the event of failure, a negative error value is returned.

ERRORS

ZX_ERR_ACCESS_DENIED handle does not have ZX_RIGHT_WRITE.

ZX_ERR_BAD_HANDLE handle is not a valid handle.

ZX_ERR_INVALID_ARGS An invalid value to options was given, or buffer was an invalid pointer.

ZX_ERR_WRONG_TYPE handle is not a debuglog handle.

SEE ALSO