Re: PAGE_SIZE export
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.
Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Who is General Failure and why is he reading my disk?
Reply to: