summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch27
1 files changed, 15 insertions, 12 deletions
diff --git a/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch b/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
index 116f3d4de6..f150bb087a 100644
--- a/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
+++ b/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
@@ -1,7 +1,7 @@
1From 3498f488b27f90398d7c8d1d06aac5ab684370e8 Mon Sep 17 00:00:00 2001 1From 085c8b6f253726ad547e7be84ff3f2b99701488b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 14 Dec 2015 00:47:53 +0000 3Date: Wed, 9 Nov 2016 19:38:07 -0800
4Subject: [PATCH 09/36] util: bypass unimplemented _SC_PHYS_PAGES system 4Subject: [PATCH 09/19] util: bypass unimplemented _SC_PHYS_PAGES system
5 configuration API on uclibc 5 configuration API on uclibc
6 6
7Upstream-Status: Inappropriate [uclibc-specific] 7Upstream-Status: Inappropriate [uclibc-specific]
@@ -12,12 +12,12 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 1 file changed, 15 insertions(+) 12 1 file changed, 15 insertions(+)
13 13
14diff --git a/src/basic/util.c b/src/basic/util.c 14diff --git a/src/basic/util.c b/src/basic/util.c
15index ea1bed7..fdaf340 100644 15index c1b5ca1..4c62d43 100644
16--- a/src/basic/util.c 16--- a/src/basic/util.c
17+++ b/src/basic/util.c 17+++ b/src/basic/util.c
18@@ -767,10 +767,25 @@ uint64_t physical_memory(void) { 18@@ -742,6 +742,20 @@ uint64_t physical_memory(void) {
19 /* We return this as uint64_t in case we are running as 32bit 19 * In order to support containers nicely that have a configured memory limit we'll take the minimum of the
20 * process on a 64bit kernel with huge amounts of memory */ 20 * physically reported amount of memory and the limit configured for the root cgroup, if there is any. */
21 21
22+#ifdef __UCLIBC__ 22+#ifdef __UCLIBC__
23+ char line[128]; 23+ char line[128];
@@ -33,14 +33,17 @@ index ea1bed7..fdaf340 100644
33+ fclose(f); 33+ fclose(f);
34+ return (uint64_t) mem; 34+ return (uint64_t) mem;
35+#else 35+#else
36 mem = sysconf(_SC_PHYS_PAGES); 36 sc = sysconf(_SC_PHYS_PAGES);
37 assert(mem > 0); 37 assert(sc > 0);
38 38
39 return (uint64_t) mem * (uint64_t) page_size(); 39@@ -762,6 +776,7 @@ uint64_t physical_memory(void) {
40 lim *= ps;
41
42 return MIN(mem, lim);
40+#endif 43+#endif
41 } 44 }
42 45
43 int update_reboot_param_file(const char *param) { 46 uint64_t physical_memory_scale(uint64_t v, uint64_t max) {
44-- 47--
451.8.3.1 482.10.2
46 49