getpagesize() problems

Michele Alberti <[email protected]>
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
Hi all,
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 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;
}

and compile it like: cc -o test test.c -nostdlib ../dietlibc.a -lgcc
and I got segfault immediately.

Other stupid test:
#include <stdio.h>

int main(void) {
    long long i;

    printf("pid:%d\n", getpid());

    for (i=0; i<10000000000; i++) ;

    sleep(1);
    return 0;
}

same compile instructions and this time the test runs well.
I don't know, maybe I'm wrong, but it seems a getpagesize() issue.
What do you think about that?
Regards,

Michele
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.