]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: change getpagesize to sysconf
authorMike Frysinger <vapier@gentoo.org>
Tue, 10 Jan 2012 02:19:48 +0000 (21:19 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 10 Jan 2012 02:19:48 +0000 (21:19 -0500)
Newer versions of glibc no longer export the getpagesize() prototype when
using recent versions of POSIX (_XOPEN_SOURCE).  So building tdb.c gives
use implicit function declaration warnings.  Fix the issue by using the
portable sysconf() function which returns the same answer.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/tdb.c

index 83c834e577dd850aeca10cd16243de7bf95c1076..61e30ed2fc5e99ab99feb35f361366ab2febb9e4 100644 (file)
@@ -114,10 +114,6 @@ static TDB_DATA tdb_null;
 #define u32 unsigned
 #endif
 
-#ifndef HAVE_GETPAGESIZE
-#define getpagesize() 0x2000
-#endif
-
 typedef u32 tdb_len_t;
 typedef u32 tdb_off_t;
 
@@ -3839,7 +3835,7 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
        tdb->hash_fn = hash_fn ? hash_fn : default_tdb_hash;
 
        /* cache the page size */
-       tdb->page_size = getpagesize();
+       tdb->page_size = sysconf(_SC_PAGESIZE);
        if (tdb->page_size <= 0) {
                tdb->page_size = 0x2000;
        }