svn commit: trunk/uClibc/libc: misc/internals sysdeps/linux/common

vapier at uclibc.org vapier at uclibc.org
Sun Jan 8 11:51:44 UTC 2006


Author: vapier
Date: 2006-01-08 03:51:43 -0800 (Sun, 08 Jan 2006)
New Revision: 13177

Log:
create a hidden internal pagesize symbol for libc usage

Modified:
   trunk/uClibc/libc/misc/internals/__uClibc_main.c
   trunk/uClibc/libc/sysdeps/linux/common/getpagesize.c


Changeset:
Modified: trunk/uClibc/libc/misc/internals/__uClibc_main.c
===================================================================
--- trunk/uClibc/libc/misc/internals/__uClibc_main.c	2006-01-08 11:47:23 UTC (rev 13176)
+++ trunk/uClibc/libc/misc/internals/__uClibc_main.c	2006-01-08 11:51:43 UTC (rev 13177)
@@ -82,7 +82,9 @@
 char **__environ = 0;
 weak_alias(__environ, environ)
 
+/* TODO: don't export __pagesize; we cant now because libpthread uses it */
 size_t __pagesize = 0;
+hidden_strong_alias(__pagesize,__pagesize_internal)
 
 #ifndef O_NOFOLLOW
 # define O_NOFOLLOW	0
@@ -150,7 +152,7 @@
 
     /* Setup an initial value.  This may not be perfect, but is
      * better than  malloc using __pagesize=0 for atexit, ctors, etc.  */
-    __pagesize = PAGE_SIZE;
+    __pagesize_internal = PAGE_SIZE;
 
 #ifdef __UCLIBC_HAS_THREADS__
     /* Before we start initializing uClibc we have to call
@@ -247,7 +249,7 @@
 
 #ifdef __ARCH_HAS_MMU__
     /* Make certain getpagesize() gives the correct answer */
-    __pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
+    __pagesize_internal = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
 
     /* Prevent starting SUID binaries where the stdin. stdout, and
      * stderr file descriptors are not already opened. */

Modified: trunk/uClibc/libc/sysdeps/linux/common/getpagesize.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/getpagesize.c	2006-01-08 11:47:23 UTC (rev 13176)
+++ trunk/uClibc/libc/sysdeps/linux/common/getpagesize.c	2006-01-08 11:51:43 UTC (rev 13177)
@@ -19,14 +19,14 @@
 #include <unistd.h>
 #include <features.h>
 #include <sys/param.h>
-extern size_t __pagesize;
+extern size_t __pagesize_internal attribute_hidden;
 
 /* Return the system page size.  */
 /* couldn't make __getpagesize hidden, because shm.h uses it in a macro */
 int attribute_hidden __getpagesize_internal(void)
 {
-  if (__pagesize != 0)
-    return __pagesize;
+  if (__pagesize_internal != 0)
+    return __pagesize_internal;
 
 #ifdef	EXEC_PAGESIZE
   return EXEC_PAGESIZE;




More information about the uClibc-cvs mailing list