6#if defined(DART_HOST_OS_FUCHSIA)
10#include <fuchsia/kernel/cpp/fidl.h>
11#include <lib/fdio/directory.h>
12#include <lib/zx/resource.h>
14#include <sys/utsname.h>
16#include <zircon/process.h>
17#include <zircon/status.h>
18#include <zircon/syscalls.h>
28const char* Platform::executable_name_ =
nullptr;
29int Platform::script_index_ = 1;
30char** Platform::argv_ =
nullptr;
37 return sysconf(_SC_NPROCESSORS_CONF);
42 int ret = uname(&
info);
46 const char*
kFormat =
"%s %s %s";
48 snprintf(
nullptr, 0, kFormat,
info.sysname,
info.release,
info.version);
72 if (
lang ==
nullptr) {
79 return gethostname(
buffer, buffer_length) == 0;
87 while (*(tmp++) !=
nullptr) {
93 for (intptr_t current = 0; current <
i; current++) {
94 result[current] = environ[current];
100 if (executable_name_ !=
nullptr) {
101 return executable_name_;
104 zx_status_t status = zx_object_get_property(zx_process_self(), ZX_PROP_NAME,
105 name, ZX_MAX_NAME_LEN);
106 if (status != ZX_OK) {
114 if (executable_name ==
nullptr) {
117 if ((executable_name[0] ==
'/') &&
File::Exists(
nullptr, executable_name)) {
120 if (strchr(executable_name,
'/') !=
nullptr) {
127 if (
path ==
nullptr) {
129 path =
"/system/bin:/system/apps:/boot/bin";
133 char* save =
nullptr;
134 while ((pathcopy = strtok_r(pathcopy,
":", &save)) !=
nullptr) {
153 zx_object_set_property(zx_process_self(), ZX_PROP_NAME,
name,
173zx_handle_t Platform::GetVMEXResource() {
175 fuchsia::kernel::VmexResourceSyncPtr vmex_resource_svc;
176 zx_status_t status = fdio_service_connect(
177 "/svc/fuchsia.kernel.VmexResource",
178 vmex_resource_svc.NewRequest().TakeChannel().release());
180 status = vmex_resource_svc->Get(&vmex_resource);
182 return vmex_resource.release();
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static SkString resource(SkPDFResourceType type, int index)
static T Minimum(T x, T y)
static void RestoreConfig()
static char * ScopedCopyCString(const char *str)
static char * ScopedCString(intptr_t length)
static const char * GetCanonicalPath(Namespace *namespc, const char *path, char *dest=nullptr, int dest_size=0)
static bool Exists(Namespace *namespc, const char *path)
DART_EXPORT void Dart_PrepareToAbort()
DART_EXPORT uint8_t * Dart_ScopeAllocate(intptr_t size)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer