Flutter Engine
The Flutter Engine
paths_linux.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include <unistd.h>
6
7#include "flutter/fml/paths.h"
8
9namespace fml {
10namespace paths {
11
12std::pair<bool, std::string> GetExecutablePath() {
13 const int path_size = 255;
14 char path[path_size] = {0};
15 auto read_size = ::readlink("/proc/self/exe", path, path_size);
16 if (read_size == -1) {
17 return {false, ""};
18 }
19 return {true, std::string{path, static_cast<size_t>(read_size)}};
20}
21
23 // Unsupported on this platform.
24 return {};
25}
26
27} // namespace paths
28} // namespace fml
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
Definition: switches.h:57
std::pair< bool, std::string > GetExecutablePath()
fml::UniqueFD GetCachesDirectory()
Definition: ascii_trie.cc:9