Replace a handle.
#include <zircon/syscalls.h> zx_status_t zx_handle_replace(zx_handle_t handle, zx_rights_t rights, zx_handle_t* out);
zx_handle_replace() creates a replacement for handle, referring to
the same underlying object, with new access rights rights.
handle is always invalidated.
If rights is ZX_RIGHT_SAME_RIGHTS, the replacement handle will have the same rights as the original handle. Otherwise, rights must be a subset of original handle's rights.
zx_handle_replace() returns ZX_OK and the replacement handle (via out)
ZX_ERR_BAD_HANDLE handle isn't a valid handle.
ZX_ERR_INVALID_ARGS The rights requested are not a subset of handle's rights or out is an invalid pointer.
ZX_ERR_NO_MEMORY Failure due to lack of memory. There is no good way for userspace to handle this (unlikely) error. In a future build this error will no longer occur.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2019-11-21.