add legacy functions from sysinfo.h duplicating sysconf functionality
authorRich Felker <dalias@aerifal.cx>
Thu, 5 Mar 2015 03:10:01 +0000 (22:10 -0500)
committerRich Felker <dalias@aerifal.cx>
Thu, 5 Mar 2015 03:10:01 +0000 (22:10 -0500)
src/conf/legacy.c [new file with mode: 0644]

diff --git a/src/conf/legacy.c b/src/conf/legacy.c
new file mode 100644 (file)
index 0000000..f1d9e32
--- /dev/null
@@ -0,0 +1,22 @@
+#include <sys/sysinfo.h>
+#include <unistd.h>
+
+int get_nprocs_conf()
+{
+       return sysconf(_SC_NPROCESSORS_CONF);
+}
+
+int get_nprocs()
+{
+       return sysconf(_SC_NPROCESSORS_ONLN);
+}
+
+long get_phys_pages()
+{
+       return sysconf(_SC_PHYS_PAGES); 
+}
+
+long get_avphys_pages()
+{
+       return sysconf(_SC_AVPHYS_PAGES);       
+}