struct fdio_namespace

Defined at line 30 of file ../../sdk/lib/fdio/namespace/local-filesystem.h

A local filesystem consisting of LocalVnodes, mapping string names

to remote handles.

This class is thread-safe.

Public Methods

void fdio_namespace (const fdio_namespace & )

Defined at line 35 of file ../../sdk/lib/fdio/namespace/local-filesystem.h

void fdio_namespace (fdio_namespace && )

Defined at line 36 of file ../../sdk/lib/fdio/namespace/local-filesystem.h

fdio_namespace & operator= (const fdio_namespace & )

Defined at line 37 of file ../../sdk/lib/fdio/namespace/local-filesystem.h

fdio_namespace & operator= (fdio_namespace && )

Defined at line 38 of file ../../sdk/lib/fdio/namespace/local-filesystem.h

zx::result<fbl::RefPtr<fdio>> OpenRoot ()

Create a new object referring to the root of this namespace.

Returns |nullptr| on failure.

Defined at line 593 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

zx_status_t SetRoot (fdio_t * io)

Change the root of this namespace to match |io|.

Does not take ownership of |io|.

Defined at line 628 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

zx_status_t Export (fdio_flat_namespace_t ** out)

Export all remote references and their paths in a flat format.

Defined at line 657 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

zx_status_t Readdir (const LocalVnode & vn, DirentIteratorState * state, zxio_dirent_t * inout_entry)

Reads a single entry from the list of directory entries into |inout_entry|.

If we have reached the end, ZX_ERR_NOT_FOUND is returned.

Defined at line 153 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

zx_status_t OpenRemoteDeprecated (std::string_view path, fuchsia_io::wire::OpenFlags flags, fidl::ServerEnd<fuchsia_io::Node> server_end)

Open a remote object within the namespace using deprecated fuchsia.io/Directory.Open1.

Returns an error if |path| does not exist.

Returns an error if |path| references a non-remote object.

TODO(https://fxbug.dev/324111518): Remove this after all callers are migrated to |OpenRemote|.

Defined at line 187 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

zx::result<fbl::RefPtr<fdio>> OpenAt (fbl::RefPtr<LocalVnode> vn, std::string_view path, fuchsia_io::Flags flags)

Open |path| relative to |vn| with specified |flags|. |path| may represent either a local node,

or a remote object.

Defined at line 125 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

zx_status_t OpenRemote (std::string_view path, fuchsia_io::Flags flags, zx::channel object)

Open a remote node at |path| within the namespace using |flags|. |path| must be an absolute

path starting from /.

Returns an error if |path| does not exist.

Returns an error if |path| references a non-remote object.

Defined at line 231 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

zx_status_t Bind (std::string_view path, fdio_open_local_func_t on_open, void * context)

Attaches a local node defined by |on_open| to |path| within the current namespace.

Defined at line 447 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

zx_status_t Bind (std::string_view path, fidl::ClientEnd<fuchsia_io::Directory> remote)

Attaches |remote| to |path| within the current namespace.

Defined at line 437 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

zx_status_t Unbind (std::string_view path)

Detaches a remote object from |path| within the current namespace.

Returns ZX_ERR_NOT_FOUND if |path| does not correspond with a bound remote.

Returns ZX_ERR_NOT_SUPPORTED if |path| is the root of the namespace.

Returns ZX_ERR_INVALID_ARGS for an unsupported |path|.

Defined at line 275 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

bool IsBound (std::string_view path)

Defined at line 416 of file ../../sdk/lib/fdio/namespace/local-filesystem.cc

Friends

class MakeRefCountedHelper