Re: getpagesize() problems
Felix von Leitner <[email protected]>
| Newsgroups | gmane.linux.lib.dietlibc |
|---|---|
| Message-ID | <[email protected]> |
> I'm developing a project that uses dietlibc since 0.30 version.
> dietlibc works well.
> Some days ago I upgrade to dietlibc 0.32 and the project stops to work
> for segfault issues.
I recently changed the implementation of getpagesize() to use the
information passed by the kernel in auxvec, when I added code to use
auxvec for other reasons.
> I investigated and discovered that getpagesize() makes the segfault.
> In fact, if I define the PAGE_SIZE directly the project works well.
> Then I made some tests with other stupid programs like:
> #include <unistd.h>
> #include <stdio.h>
> #include <sys/user.h>
> int main(void) {
> int size = getpagesize();
> int size2 = PAGE_SIZE-1;
> printf("size: %u\n", size);
> printf("size2: %u\n", size2);
> return 0;
> }
This works fine for me (apart from the fact that sys/user.h does not
exist for dietlibc and PAGE_SIZE is defined in sys/shm.h).
What environment are you using this program in?
x86? Inside user mode linux? What kernel version?
Felix