summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-15 23:15:00 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-22 09:16:00 +0100
commit4c2d0b1205be2c0e42cafea1de18e46edf4a374b (patch)
tree929918f4745764c3b5618f1489e540cf0645eeb4 /meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
parent39df3561d8cb0d6d86d492bb462640cf2f0a760a (diff)
downloadpoky-4c2d0b1205be2c0e42cafea1de18e46edf4a374b.tar.gz
meta: Remove further uclibc remnants (inc. patches and site files)
Some of these are clearly dead, e.g. one binutils patch reverts the effects of the earlier one. This also removes the uclibc site files. We now have mechanisms to allow these to be extended from another layer should someone ever wish to do that. (From OE-Core rev: e01e7c543a559c8926d72159b5cd55db0c661434) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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.patch49
1 files changed, 0 insertions, 49 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
deleted file mode 100644
index f150bb087a..0000000000
--- a/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From 085c8b6f253726ad547e7be84ff3f2b99701488b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 9 Nov 2016 19:38:07 -0800
4Subject: [PATCH 09/19] util: bypass unimplemented _SC_PHYS_PAGES system
5 configuration API on uclibc
6
7Upstream-Status: Inappropriate [uclibc-specific]
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/basic/util.c | 15 +++++++++++++++
12 1 file changed, 15 insertions(+)
13
14diff --git a/src/basic/util.c b/src/basic/util.c
15index c1b5ca1..4c62d43 100644
16--- a/src/basic/util.c
17+++ b/src/basic/util.c
18@@ -742,6 +742,20 @@ uint64_t physical_memory(void) {
19 * In order to support containers nicely that have a configured memory limit we'll take the minimum of the
20 * physically reported amount of memory and the limit configured for the root cgroup, if there is any. */
21
22+#ifdef __UCLIBC__
23+ char line[128];
24+ FILE *f = fopen("/proc/meminfo", "r");
25+ if (f == NULL)
26+ return 0;
27+ while (!feof(f) && fgets(line, sizeof(line)-1, f)) {
28+ if (sscanf(line, "MemTotal: %li kB", &mem) == 1) {
29+ mem *= 1024;
30+ break;
31+ }
32+ }
33+ fclose(f);
34+ return (uint64_t) mem;
35+#else
36 sc = sysconf(_SC_PHYS_PAGES);
37 assert(sc > 0);
38
39@@ -762,6 +776,7 @@ uint64_t physical_memory(void) {
40 lim *= ps;
41
42 return MIN(mem, lim);
43+#endif
44 }
45
46 uint64_t physical_memory_scale(uint64_t v, uint64_t max) {
47--
482.10.2
49