This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Remove the getpagesize system call from ia64
- To: "H . J . Lu" <hjl at valinux dot com>
- Subject: Re: Remove the getpagesize system call from ia64
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 11 Jan 2001 00:05:52 +0100
- Cc: GNU C Library <libc-alpha at sourceware dot cygnus dot com>, notting at redhat dot com
- References: <20010110102331.A22665@valinux.com>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Wed, Jan 10, 2001 at 10:23:31AM -0800, H . J . Lu wrote:
> AT_PAGESZ works on the current ia64 kernel.
Unfortunately, not fully yet :(.
Consider statically linked:
#include <stdio.h>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
int main() {
struct passwd *foo;
foo=getpwuid(2166);
printf("%d %d\n",foo->pw_uid,foo->pw_gid);
}
This will crash. Although _dl_pagesize is set properly in the main program,
when it dlopens libnss_files.so.2 which in turn drags in libc.so.6.1 and
ld-linux-ia64.so.2. Now when libnss_files.so.2 calls __getpagesize(), it
uses _dl_pagesize variable present in ld-linux-ia64.so.2 which has not been
initialized and thus it either crashes immediately or later on (if
-DNDEBUG=1). At least I believe this is happening from what Bill Nottingham
told me. I think one solution could be to have the getpagesize syscall for
this case, another one would be to have a list of ld.so variables which need
to be initialized to their static originals, like have something like:
{ "_dl_pagesize", &_dl_pagesize },
and during dlopen #ifndef SHARED go through that list and copy the content.
Jakub