[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PAGE_SIZE export



Martin Mares a écrit :
> Hello!
> 
>> False, the glibc has nevered exported PAGE_SIZE, it has always been
>> provided by kernel headers.
> 
> Sorry, but that's not true. If I download
> /debian/pool/main/g/glibc/glibc_2.3.6.ds1.orig.tar.gz, extract it, extract
> glibc-2.3.6.ds1.tar.bz2 inside and look at
> glibc-2.3.6/sysdeps/unix/sysv/linux/i386/sys/user.h, I see:
> 
> | #define PAGE_SHIFT              12
> | #define PAGE_SIZE               (1UL << PAGE_SHIFT)
> | #define PAGE_MASK               (~(PAGE_SIZE-1))
> 
> This file is normally installed as /usr/include/sys/user.h.
> 
> The Debian patch glibc_2.3.6.ds1-9.diff.gz (namely glibc-2.3.6.ds1/debian/patches/any/local-no-pagesize.diff)
> contains:
> 
> | +--- glibc-2.3.6.orig/sysdeps/unix/sysv/linux/i386/sys/user.h   2001-07-06 06:56:17.000000000 +0200
> | ++++ glibc-2.3.6/sysdeps/unix/sysv/linux/i386/sys/user.h        2006-10-21 22:38:40.748151944 +0200
> | +@@ -23,6 +23,8 @@
> | +    too much into it.  Don't use it for anything other than GDB unless
> | +    you know what you are doing.  */
> | + 
> | ++#include <unistd.h>
> | ++
> | + struct user_fpregs_struct
> | + {
> | +   long int cwd;
> | +@@ -92,8 +94,7 @@
> | +   int                         u_debugreg [8];
> | + };
> | + 
> | +-#define PAGE_SHIFT            12
> | +-#define PAGE_SIZE             (1UL << PAGE_SHIFT)
> | ++#define PAGE_SIZE             sysconf(_SC_PAGESIZE)
> | + #define PAGE_MASK             (~(PAGE_SIZE-1))
> | + #define NBPG                  PAGE_SIZE
> | + #define UPAGES                        1
> 
> What's the purpose of this change?
> 
>> Again false, it has been part of the kernel API since ages. The kernel
>> API has changed, please blame the kernel developers, not us.
> 
> I am not talking about kernel API, but about glibc API, which is changed
> by the patch.

Oops sorry. So basically this only affects i386. We will probably change
that for glibc 2.5.

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net



Reply to: