diff options
| author | Natanael Copa <ncopa@alpinelinux.org> | 2014-04-15 10:42:18 +0200 |
|---|---|---|
| committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-04-15 10:42:53 +0200 |
| commit | b6c00d70308d31517175e50e2115b8c212738ae2 (patch) | |
| tree | 97e47ecc76e40e711e0f8e979d6aa7936535110d /main/libvirt/uclibc-physmem.patch | |
| parent | 003673bf5821cbf910ccf637bd319ce2e6aa86fd (diff) | |
| download | aports-b6c00d70308d31517175e50e2115b8c212738ae2.tar.bz2 aports-b6c00d70308d31517175e50e2115b8c212738ae2.tar.xz | |
main/libvirt: update physmem patch for musl
Diffstat (limited to 'main/libvirt/uclibc-physmem.patch')
| -rw-r--r-- | main/libvirt/uclibc-physmem.patch | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/main/libvirt/uclibc-physmem.patch b/main/libvirt/uclibc-physmem.patch deleted file mode 100644 index 73de5ac4ec..0000000000 --- a/main/libvirt/uclibc-physmem.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ./gnulib/lib/physmem.c.orig -+++ ./gnulib/lib/physmem.c -@@ -23,6 +23,7 @@ - #include "physmem.h" - - #include <unistd.h> -+#include <stdio.h> - - #if HAVE_SYS_PSTAT_H - # include <sys/pstat.h> -@@ -81,6 +82,22 @@ - double - physmem_total (void) - { -+#if defined(__UCLIBC__) -+ char line[128]; -+ FILE *f = fopen("/proc/meminfo", "r"); -+ long double result = -1; -+ if (f == NULL) -+ return 0; -+ while (!feof(f) && fgets(line, sizeof(line)-1, f)) { -+ if (sscanf(line, "MemTotal: %Lf kB", &result) == 1) { -+ result *= 1024; -+ break; -+ } -+ } -+ fclose(f); -+ return result; -+#endif -+ - #if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE - { /* This works on linux-gnu, solaris2 and cygwin. */ - double pages = sysconf (_SC_PHYS_PAGES); |
