From 62f9a51532f5dac19fcf4dfdaaa37c1114049500 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Thu, 2 Jul 2015 20:54:11 +1000 Subject: [PATCH] library: remove procps_pagesize_get() This is actually a systemcall getpagesize(2) or it is defined in configure using a variety of methods, including a default hard coded value as a last resort. There is no need to have this in libprocps --- proc/libprocps.sym | 1 - proc/sysinfo.c | 16 ---------------- proc/sysinfo.h | 1 - top/top.c | 2 +- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/proc/libprocps.sym b/proc/libprocps.sym index c3d4c87b..fd2980c5 100644 --- a/proc/libprocps.sym +++ b/proc/libprocps.sym @@ -36,7 +36,6 @@ global: procps_meminfo_unref; procps_meminfo_get; procps_meminfo_get_chain; - procps_pagesize_get; procps_stat_new; procps_stat_read; procps_stat_read_jiffs; diff --git a/proc/sysinfo.c b/proc/sysinfo.c index 01d92058..13175bb8 100644 --- a/proc/sysinfo.c +++ b/proc/sysinfo.c @@ -113,22 +113,6 @@ PROCPS_EXPORT long procps_hertz_get(void) return 100; } -/* - * procps_pagesize_get: - * - * Return the size of pages in bytes - * - * Returns: size of pages in bytes - */ -PROCPS_EXPORT long procps_pagesize_get(void) -{ - long psiz; - - if ((psiz = sysconf(_SC_PAGESIZE)) > 0) - return psiz; - return 1; -} - /* * procps_loadavg: * @av1: location to store 1 minute load average diff --git a/proc/sysinfo.h b/proc/sysinfo.h index a0d020ff..d025415a 100644 --- a/proc/sysinfo.h +++ b/proc/sysinfo.h @@ -11,7 +11,6 @@ extern int have_privs; /* boolean, true if setuid or similar */ long procps_cpu_count(void); long procps_hertz_get(void); int procps_loadavg(double *av1, double *av5, double *av15); -long procps_pagesize_get(void); #define BUFFSIZE (64*1024) typedef unsigned long long jiff; diff --git a/top/top.c b/top/top.c index 5dd60195..e10fa991 100644 --- a/top/top.c +++ b/top/top.c @@ -3253,7 +3253,7 @@ static void before (char *me) { // establish cpu particulars Hertz = procps_hertz_get(); Cpu_cnt = procps_cpu_count(); - Page_size = procps_pagesize_get(); + Page_size = getpagesize(); #ifdef PRETEND8CPUS Cpu_cnt = 8; #endif -- 2.40.0