blob: b1caa60c4a932d5964687fb825a704bcb57afdf5 (
plain)
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
|
Upstream-Status: Pending
Description: non-x86 arches do not have PAGE_SIZE
Forwarded: not-needed
--- a/system/core/base/cmsg.cpp
+++ b/system/core/base/cmsg.cpp
@@ -33,7 +33,8 @@
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) {
+ size_t pagesize = static_cast<size_t>(sysconf(_SC_PAGE_SIZE));
+ if (cmsg_space >= pagesize) {
errno = ENOMEM;
return -1;
}
@@ -75,7 +76,8 @@
fds->clear();
size_t cmsg_space = CMSG_SPACE(sizeof(int) * max_fds);
- if (cmsg_space >= PAGE_SIZE) {
+ size_t pagesize = static_cast<size_t>(sysconf(_SC_PAGE_SIZE));
+ if (cmsg_space >= pagesize) {
errno = ENOMEM;
return -1;
}
|