[git commit future 1/1] internals.h: use sysconf(_SC_PAGESIZE) instead of __pagesize

Khem Raj raj.khem at gmail.com
Sat Mar 19 18:51:25 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=1b954334d65cce444c8a871c544fadd84d645d78
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

Rename PAGE_SIZE to __PAGE_SIZE to be sure that we do not get the
definition from uClibc_page.h.

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 libpthread/linuxthreads.old/internals.h |   16 ++++++----------
 libpthread/linuxthreads/internals.h     |   10 ++++------
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/libpthread/linuxthreads.old/internals.h b/libpthread/linuxthreads.old/internals.h
index 110dd9d..83f6b50 100644
--- a/libpthread/linuxthreads.old/internals.h
+++ b/libpthread/linuxthreads.old/internals.h
@@ -327,32 +327,28 @@ static __inline__ int invalid_handle(pthread_handle h, pthread_t id)
 
 /* The page size we can get from the system.  This should likely not be
    changed by the machine file but, you never know.  */
-extern size_t __pagesize;
-#include <bits/uClibc_page.h>
-#ifndef PAGE_SIZE
-#define PAGE_SIZE  (sysconf (_SC_PAGESIZE))
-#endif
+#define __PAGE_SIZE  (sysconf (_SC_PAGESIZE))
 
 /* The max size of the thread stack segments.  If the default
    THREAD_SELF implementation is used, this must be a power of two and
-   a multiple of PAGE_SIZE.  */
+   a multiple of __PAGE_SIZE.  */
 #ifndef STACK_SIZE
 #ifdef __ARCH_USE_MMU__
 #define STACK_SIZE  (2 * 1024 * 1024)
 #else
-#define STACK_SIZE  (4 * __pagesize)
+#define STACK_SIZE  (4 * __PAGE_SIZE)
 #endif
 #endif
 
-/* The initial size of the thread stack.  Must be a multiple of PAGE_SIZE.  */
+/* The initial size of the thread stack.  Must be a multiple of __PAGE_SIZE.  */
 #ifndef INITIAL_STACK_SIZE
-#define INITIAL_STACK_SIZE  (4 * __pagesize)
+#define INITIAL_STACK_SIZE  (4 * __PAGE_SIZE)
 #endif
 
 /* Size of the thread manager stack. The "- 32" avoids wasting space
    with some malloc() implementations. */
 #ifndef THREAD_MANAGER_STACK_SIZE
-#define THREAD_MANAGER_STACK_SIZE  (2 * __pagesize - 32)
+#define THREAD_MANAGER_STACK_SIZE  (2 * __PAGE_SIZE - 32)
 #endif
 
 /* The base of the "array" of thread stacks.  The array will grow down from
diff --git a/libpthread/linuxthreads/internals.h b/libpthread/linuxthreads/internals.h
index eb0a519..89aa1b6 100644
--- a/libpthread/linuxthreads/internals.h
+++ b/libpthread/linuxthreads/internals.h
@@ -200,19 +200,17 @@ static __inline__ int nonexisting_handle(pthread_handle h, pthread_t id)
 
 /* The page size we can get from the system.  This should likely not be
    changed by the machine file but, you never know.  */
-#ifndef PAGE_SIZE
-#define PAGE_SIZE  (sysconf (_SC_PAGE_SIZE))
-#endif
+#define __PAGE_SIZE  (sysconf (_SC_PAGESIZE))
 
-/* The initial size of the thread stack.  Must be a multiple of PAGE_SIZE.  */
+/* The initial size of the thread stack.  Must be a multiple of __PAGE_SIZE.  */
 #ifndef INITIAL_STACK_SIZE
-#define INITIAL_STACK_SIZE  (4 * PAGE_SIZE)
+#define INITIAL_STACK_SIZE  (4 * __PAGE_SIZE)
 #endif
 
 /* Size of the thread manager stack. The "- 32" avoids wasting space
    with some malloc() implementations. */
 #ifndef THREAD_MANAGER_STACK_SIZE
-#define THREAD_MANAGER_STACK_SIZE  (2 * PAGE_SIZE - 32)
+#define THREAD_MANAGER_STACK_SIZE  (2 * __PAGE_SIZE - 32)
 #endif
 
 /* The base of the "array" of thread stacks.  The array will grow down from
-- 
1.7.3.4



More information about the uClibc-cvs mailing list