From 3b950e41896219c9d21f9bc13616bfc6333b345c Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 11 Mar 2009 13:15:43 +0000 Subject: BSD related fixes: * BUGFIX: Correct page size calculation for FreeBSD systems (thanks to Andrew Paulsen) * Allow compilation without PLPA on systems that don't support it (thanks to Timothy Redaelli) --- Process.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Process.h') diff --git a/Process.h b/Process.h index 54dbf87f..620eb75a 100644 --- a/Process.h +++ b/Process.h @@ -31,13 +31,16 @@ in the source distribution for its full text. #include #include +#ifdef HAVE_PLPA #include +#endif // This works only with glibc 2.1+. On earlier versions // the behavior is similar to have a hardcoded page size. #ifndef PAGE_SIZE -#define PAGE_SIZE ( sysconf(_SC_PAGESIZE) / 1024 ) +#define PAGE_SIZE ( sysconf(_SC_PAGESIZE) ) #endif +#define PAGE_SIZE_KB ( PAGE_SIZE / ONE_K ) #define PROCESS_COMM_LEN 300 @@ -172,9 +175,11 @@ void Process_toggleTag(Process* this); bool Process_setPriority(Process* this, int priority); +#ifdef HAVE_PLPA unsigned long Process_getAffinity(Process* this); bool Process_setAffinity(Process* this, unsigned long mask); +#endif void Process_sendSignal(Process* this, int signal); -- cgit v1.2.3