From 5e3d8e668238f1ebbf96843ceb0a699d73a16a38 Mon Sep 17 00:00:00 2001 From: Nicolas Cavallari Date: Tue, 14 Jun 2016 15:12:18 +0200 Subject: sysconf: Support _SC_(AV)?PHYS_PAGES. Do it by following the trail of the existing commented code, which implemented it by calling get_phys_pages() and get_avphys_pages(). This patch implements these two functions, which are also glibc extensions. Some program/libraries (e.g. libuv) assumes that sysconf(_SC_PHYS_PAGES) works on linux and never check for -1, thus they report an insane amount of memory. Signed-off-by: Nicolas Cavallari --- include/sys/sysinfo.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/sys/sysinfo.h') diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h index 00e363371..4e756e99e 100644 --- a/include/sys/sysinfo.h +++ b/include/sys/sysinfo.h @@ -56,13 +56,11 @@ extern int sysinfo (struct sysinfo *__info) __THROW; #define get_nprocs() (sysconf(_SC_NPROCESSORS_ONLN)) -#if 0 /* Return number of physical pages of memory in the system. */ extern long int get_phys_pages (void) __THROW; /* Return number of available physical pages of memory in the system. */ extern long int get_avphys_pages (void) __THROW; -#endif __END_DECLS -- cgit v1.2.3