-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem_core.patch
84 lines (72 loc) · 2.32 KB
/
system_core.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff --git a/adb/types.h b/adb/types.h
index cd1366dfb..696890cf0 100644
--- a/adb/types.h
+++ b/adb/types.h
@@ -23,6 +23,8 @@
#include <utility>
#include <vector>
+#include <string.h>
+
#include <android-base/logging.h>
#include "sysdeps/uio.h"
diff --git a/base/cmsg.cpp b/base/cmsg.cpp
index 42866f8f2..04e499a2c 100644
--- a/base/cmsg.cpp
+++ b/base/cmsg.cpp
@@ -33,7 +33,7 @@ ssize_t SendFileDescriptorVector(int sockfd, const void* data, size_t len,
const std::vector<int>& fds) {
size_t cmsg_space = CMSG_SPACE(sizeof(int) * fds.size());
size_t cmsg_len = CMSG_LEN(sizeof(int) * fds.size());
- if (cmsg_space >= PAGE_SIZE) {
+ if (cmsg_space >= (size_t)sysconf(_SC_PAGE_SIZE)) {
errno = ENOMEM;
return -1;
}
@@ -75,7 +75,7 @@ ssize_t ReceiveFileDescriptorVector(int sockfd, void* data, size_t len, size_t m
fds->clear();
size_t cmsg_space = CMSG_SPACE(sizeof(int) * max_fds);
- if (cmsg_space >= PAGE_SIZE) {
+ if (cmsg_space >= (size_t)sysconf(_SC_PAGE_SIZE)) {
errno = ENOMEM;
return -1;
}
diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp
index 296995efe..48269b675 100644
--- a/base/errors_unix.cpp
+++ b/base/errors_unix.cpp
@@ -17,6 +17,7 @@
#include "android-base/errors.h"
#include <errno.h>
+#include <string.h>
namespace android {
namespace base {
diff --git a/fs_mgr/liblp/reader.cpp b/fs_mgr/liblp/reader.cpp
index dcee6d2d8..02f2b6547 100644
--- a/fs_mgr/liblp/reader.cpp
+++ b/fs_mgr/liblp/reader.cpp
@@ -19,6 +19,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#include <functional>
diff --git a/fs_mgr/liblp/writer.cpp b/fs_mgr/liblp/writer.cpp
index bffcb7e6e..a360eb5aa 100644
--- a/fs_mgr/liblp/writer.cpp
+++ b/fs_mgr/liblp/writer.cpp
@@ -18,6 +18,7 @@
#include <inttypes.h>
#include <unistd.h>
+#include <string.h>
#include <string>
diff --git a/libcutils/include/cutils/threads.h b/libcutils/include/cutils/threads.h
index ba4846e33..197066171 100644
--- a/libcutils/include/cutils/threads.h
+++ b/libcutils/include/cutils/threads.h
@@ -33,7 +33,7 @@ extern "C" {
// Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows.
//
-extern pid_t gettid();
+//extern pid_t gettid();
//
// Deprecated: use `_Thread_local` in C or `thread_local` in C++.