From c527fd1f14c27855a37f2e8ac5346ce8d940ced2 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 16 Oct 2014 03:05:19 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- .../systemd/systemd/uclibc-get-physmem.patch | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch (limited to 'meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch') diff --git a/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch new file mode 100644 index 0000000000..39dfc9e2ea --- /dev/null +++ b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch @@ -0,0 +1,37 @@ +bypass unimplemented _SC_PHYS_PAGES system configuration API in uclibc + +Upstream-Status: Inappropriate [uclibc-specific] + +Signed-off-by: Khem Raj + +Index: git/src/shared/util.c +=================================================================== +--- git.orig/src/shared/util.c 2014-03-15 18:09:34.796358146 -0700 ++++ git/src/shared/util.c 2014-03-15 20:16:33.836501084 -0700 +@@ -6332,11 +6332,24 @@ + + /* We return this as uint64_t in case we are running as 32bit + * process on a 64bit kernel with huge amounts of memory */ +- ++#ifdef __UCLIBC__ ++ char line[128]; ++ FILE *f = fopen("/proc/meminfo", "r"); ++ if (f == NULL) ++ return 0; ++ while (!feof(f) && fgets(line, sizeof(line)-1, f)) { ++ if (sscanf(line, "MemTotal: %l kB", &mem) == 1) { ++ mem *= 1024; ++ break; ++ } ++ } ++ fclose(f); ++ return (uint64_t) mem; ++#else + mem = sysconf(_SC_PHYS_PAGES); + assert(mem > 0); +- + return (uint64_t) mem * (uint64_t) page_size(); ++#endif + } + + char* mount_test_option(const char *haystack, const char *needle) { -- cgit v1.2.3-54-g00ecf