]> granicus.if.org Git - procps-ng/commitdiff
library: remove procps_pagesize_get()
authorCraig Small <csmall@enc.com.au>
Thu, 2 Jul 2015 10:54:11 +0000 (20:54 +1000)
committerCraig Small <csmall@enc.com.au>
Thu, 2 Jul 2015 10:54:11 +0000 (20:54 +1000)
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
proc/sysinfo.c
proc/sysinfo.h
top/top.c

index c3d4c87b7f6baaf4ad9fdeb38035932c4de052b2..fd2980c562bcbb445cd86dc70ac242d0906b5e78 100644 (file)
@@ -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;
index 01d920581c07f09ad70edd491cb3365ed8cda74f..13175bb8bcb1a65e0ccbfab5e4139404ea48845a 100644 (file)
@@ -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
index a0d020ff4df5038c6ce8e89ffc2351f345f0e5ac..d025415a6d5ba633e9ffd758c2e58da62377b92c 100644 (file)
@@ -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;
index 5dd60195cca988ed2cbdce2efe44f882711a4310..e10fa9917b4e75d923cbc06707e9fc13c0879b35 100644 (file)
--- 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