跳转至

zx_handle_close

SUMMARY

Close a handle.

DECLARATION

#include <zircon/syscalls.h>

zx_status_t zx_handle_close(zx_handle_t handle);

DESCRIPTION

zx_handle_close() closes a handle, causing the underlying object to be reclaimed by the kernel if no other handles to it exist.

If the handle was used in a pending [zx_object_wait_one()] or a [zx_object_wait_many()] call, the wait will be aborted.

It is not an error to close the special "never a valid handle" ZX_HANDLE_INVALID, similar to free(NULL) being a valid call.

Closing the last handle to a peered object using zx_handle_close() can affect the state of the object's peer (if any). See also [peered-objects][peered-objects].

RIGHTS

None.

RETURN VALUE

zx_handle_close() returns ZX_OK on success.

ERRORS

ZX_ERR_BAD_HANDLE handle isn't a valid handle.

SEE ALSO

[peered-objects](../kernel_objects/objects.md#peered-objects-and-the-peer-closed-state

) - [zx_handle_close_many()] - [zx_handle_duplicate()] - [zx_handle_replace()]

zx_handle_close_many()zx_handle_duplicate()zx_handle_replace()zx_object_wait_many()zx_object_wait_one()


最后更新: 2022 年 12 月 31 日(Saturday) 21:07 CST