Acked-by: Latchesar Ionkov <[EMAIL PROTECTED]>

On Oct 30, 2008, at 12:42 PM, Abhishek Kulkarni wrote:


xcpufs fails to compile on the cluster here with:

make -C xcpufs
make[1]: Entering directory `/home/kulkarni/sxcpu/xcpufs'
cc -Wall -g -I ../include -DSYSNAME=Linux -c proc-Linux.c
proc-Linux.c:13:22: error: asm/page.h: No such file or directory
proc-Linux.c: In function ‘get_size’:
proc-Linux.c:419: warning: format ‘%lu’ expects type ‘long unsigned
int’, but argument 3 has type ‘int’
make[1]: *** [proc-Linux.o] Error 1
make[1]: Leaving directory `/home/kulkarni/sxcpu/xcpufs'
make: *** [binaries] Error 2

Do we need asm/page.h?
it is harder to find these days, besides getpagesize() is marked
"LEGACY" -- replacing it with _SC_PAGESIZE which is supposedly more
portable.

Signed-off-by: Abhishek Kulkarni <[EMAIL PROTECTED]>

Index: proc-Linux.c
===================================================================
--- proc-Linux.c        (revision 709)
+++ proc-Linux.c        (working copy)
@@ -10,7 +10,6 @@
#include <time.h>
#include <sys/stat.h>
#include <asm/param.h>
-#include <asm/page.h>
#include "spfs.h"
#include "spclient.h"
#include "strutil.h"
@@ -416,7 +415,7 @@
       if (*s != '\0')
               return strdup("-1");

-       sprintf(buf, "%lu", n * getpagesize());
+       sprintf(buf, "%lu", n * sysconf(_SC_PAGESIZE));
       return strdup(buf);
}




Reply via email to