<lib/fdio/directory.h> in fdio

Header source code

fdio_open(…) {:#fdio_open}

Declaration source code

Opens an object at path relative to the root of the namespace for the current process with flags asynchronously.

flags is a fuchsia.io/OpenFlags.

Always consumes request.

See fdio_ns_open for details.

fdio_open_at(…) {:#fdio_open_at}

Declaration source code

Opens an object at path relative to directory with flags asynchronously.

Upon success, request is handed off to the remote party. The operation completes asynchronously, which means a ZX_OK result does not ensure that the requested service actually exists.

directory must be a channel that implements the fuchsia.io/Directory protocol.

request must be a channel which will always be consumed by this function.

Errors

ZX_ERR_INVALID_ARGS: directory or path is invalid.

fdio_open_fd(…) {:#fdio_open_fd}

Declaration source code

Opens an object at path relative to the root of the namespace for the current process with flags synchronously, and on success, binds that channel to a file descriptor, returned via out_fd.

Note that unlike fdio_open, this function is synchronous. This is because it produces a file descriptor, which requires synchronously waiting for the open to complete.

flags is a fuchsia.io/OpenFlags.

See fdio_open for details.

fdio_open_fd_at(…) {:#fdio_open_fd_at}

Declaration source code

Opens an object at path relative to dir_fd with flags synchronously, and on success, binds that channel to a file descriptor, returned via out_fd.

Note that unlike fdio_open, this function is synchronous. This is because it produces a file descriptor, which requires synchronously waiting for the open to complete.

flags is a fuchsia.io/OpenFlags.

See fdio_open_at fort details.

fdio_service_clone(…) {:#fdio_service_clone}

Declaration source code

Clone the given node asynchronously.

node must be a channel that implements the fuchsia.io/Node protocol.

Upon success, returns a handle to a newly created channel whose remote endpoint has been sent to node as a request for a clone.

The node is cloned as readable and writable.

Upon failure, returns ZX_HANDLE_INVALID.

fdio_service_clone_to(…) {:#fdio_service_clone_to}

Declaration source code

Requests that request be connected to a clone of the given node asynchronously.

node must be a channel that implements the fuchsia.io/Node protocol.

request must be a channel.

Upon success, request has been sent to node as a request for a clone. The node is cloned as readable and writable.

Errors

  • ZX_ERR_INVALID_ARGS: node or request is invalid.

Returns transport- and application-level errors associated with fuchsia.io/Node.Clone.

fdio_service_connect(…) {:#fdio_service_connect}

Declaration source code

Connects to a service at path relative to the root of the namespace for the current process asynchronously.

request must be a channel.

Always consumes request.

See fdio_ns_service_connect for details.

fdio_service_connect_at(…) {:#fdio_service_connect_at}

Declaration source code

Connects to a service at the given path relative to the given directory asynchronously.

Upon success, the request is handed off to the remote party. The operation completes asynchronously, which means a ZX_OK result does not ensure that the requested service actually exists.

directory must be a channel that implements the fuchsia.io/Directory protocol.

request must be a channel. It will always be consumed by this function.

Errors

ZX_ERR_INVALID_ARGS: directory or path is invalid.

fdio_service_connect_by_name(…) {:#fdio_service_connect_by_name}

Declaration source code

Connect to a service named name in /svc.