OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_LINUX_UTIL_H_ | 5 #ifndef BASE_LINUX_UTIL_H_ |
6 #define BASE_LINUX_UTIL_H_ | 6 #define BASE_LINUX_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/base_export.h" | 14 #include "base/base_export.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 | 17 |
18 static const char kFindInodeSwitch[] = "--find-inode"; | 18 extern const char kFindInodeSwitch[]; |
19 | 19 |
20 // This should be kept in sync with sandbox/linux/suid/sandbox.c | 20 extern const long kSUIDSandboxApiNumber; |
21 static const long kSUIDSandboxApiNumber = 1; | 21 extern const char kSandboxEnvironmentApiRequest[]; |
22 static const char kSandboxEnvironmentApiRequest[] = "SBX_CHROME_API_RQ"; | 22 extern const char kSandboxEnvironmentApiProvides[]; |
23 static const char kSandboxEnvironmentApiProvides[] = "SBX_CHROME_API_PRV"; | |
24 | 23 |
25 // This is declared here so the crash reporter can access the memory directly | 24 // This is declared here so the crash reporter can access the memory directly |
26 // in compromised context without going through the standard library. | 25 // in compromised context without going through the standard library. |
27 BASE_EXPORT extern char g_linux_distro[]; | 26 BASE_EXPORT extern char g_linux_distro[]; |
28 | 27 |
29 // Get the Linux Distro if we can, or return "Unknown". | 28 // Get the Linux Distro if we can, or return "Unknown". |
30 BASE_EXPORT std::string GetLinuxDistro(); | 29 BASE_EXPORT std::string GetLinuxDistro(); |
31 | 30 |
32 // Set the Linux Distro string. | 31 // Set the Linux Distro string. |
33 BASE_EXPORT void SetLinuxDistro(const std::string& distro); | 32 BASE_EXPORT void SetLinuxDistro(const std::string& distro); |
(...skipping 10 matching lines...) Expand all Loading... |
44 // |expected_data|, where N is the length of |expected_data|. | 43 // |expected_data|, where N is the length of |expected_data|. |
45 // Returns the thread id or -1 on error. If |syscall_supported| is | 44 // Returns the thread id or -1 on error. If |syscall_supported| is |
46 // set to false the kernel does not support syscall in procfs. | 45 // set to false the kernel does not support syscall in procfs. |
47 BASE_EXPORT pid_t FindThreadIDWithSyscall(pid_t pid, | 46 BASE_EXPORT pid_t FindThreadIDWithSyscall(pid_t pid, |
48 const std::string& expected_data, | 47 const std::string& expected_data, |
49 bool* syscall_supported); | 48 bool* syscall_supported); |
50 | 49 |
51 } // namespace base | 50 } // namespace base |
52 | 51 |
53 #endif // BASE_LINUX_UTIL_H_ | 52 #endif // BASE_LINUX_UTIL_H_ |
OLD | NEW |