v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
platform-linux.h
Go to the documentation of this file.
1// Copyright 2022 the V8 project 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#ifndef V8_BASE_PLATFORM_PLATFORM_LINUX_H_
6#define V8_BASE_PLATFORM_PLATFORM_LINUX_H_
7
8#include <sys/types.h>
9
10#include <cstdint>
11#include <optional>
12#include <string>
13
16
17namespace v8 {
18namespace base {
19
20// Represents a memory region, as parsed from /proc/PID/maps.
21// Visible for testing.
23 uintptr_t start;
24 uintptr_t end;
25 char permissions[5];
26 off_t offset;
27 dev_t dev;
28 ino_t inode;
29 std::string pathname;
30
31 // |line| must not contains the tail '\n'.
32 static std::optional<MemoryRegion> FromMapsLine(const char* line);
33};
34
35// The |fp| parameter is for testing, to pass a fake /proc/self/maps file.
36V8_BASE_EXPORT std::vector<OS::SharedLibraryAddress> GetSharedLibraryAddresses(
37 FILE* fp);
38
39} // namespace base
40} // namespace v8
41
42#endif // V8_BASE_PLATFORM_PLATFORM_LINUX_H_
#define V8_BASE_EXPORT
Definition base-export.h:26
std::vector< OS::SharedLibraryAddress > GetSharedLibraryAddresses(FILE *fp)