Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
namespace_fuchsia.h
Go to the documentation of this file.
1// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_BIN_NAMESPACE_FUCHSIA_H_
6#define RUNTIME_BIN_NAMESPACE_FUCHSIA_H_
7
8#include "platform/globals.h"
9#if !defined(DART_HOST_OS_FUCHSIA)
10#error "This header file should only be included when targeting Fuchsia."
11#endif
12
13#include <lib/fdio/namespace.h>
14
15namespace dart {
16namespace bin {
17
19 public:
20 explicit NamespaceImpl(fdio_ns_t* fdio_ns);
21 explicit NamespaceImpl(const char* path);
23
24 intptr_t rootfd() const { return rootfd_; }
25 char* cwd() const { return cwd_; }
26 intptr_t cwdfd() const { return cwdfd_; }
27 fdio_ns_t* fdio_ns() const { return fdio_ns_; }
28
29 bool SetCwd(Namespace* namespc, const char* new_path);
30
31 private:
32 fdio_ns_t* fdio_ns_; // native namespace object, if any.
33 intptr_t rootfd_; // dirfd for the namespace root.
34 char* cwd_; // cwd relative to the namespace.
35 intptr_t cwdfd_; // dirfd for the cwd.
36
38};
39
40} // namespace bin
41} // namespace dart
42
43#endif // RUNTIME_BIN_NAMESPACE_FUCHSIA_H_
NamespaceImpl(const char *path)
fdio_ns_t * fdio_ns() const
NamespaceImpl(fdio_ns_t *fdio_ns)
bool SetCwd(Namespace *namespc, const char *new_path)
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition globals.h:581