tools/nolibc: fix return type of getpagesize()
authorThomas Weißschuh <linux@weissschuh.net>
Thu, 3 Aug 2023 07:28:46 +0000 (09:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2023 03:17:07 +0000 (05:17 +0200)
It's documented as returning int which is also implemented by glibc and
musl, so adopt that return type.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
tools/include/nolibc/sys.h
tools/testing/selftests/nolibc/nolibc-test.c

index e12dd962c5788ae365f51c5ce1ec2a520108f752..c151533ba8e9128d03c7796e9574ce8000a288b1 100644 (file)
@@ -460,11 +460,11 @@ pid_t gettid(void)
 static unsigned long getauxval(unsigned long key);
 
 /*
- * long getpagesize(void);
+ * int getpagesize(void);
  */
 
 static __attribute__((unused))
-long getpagesize(void)
+int getpagesize(void)
 {
        return __sysret(getauxval(AT_PAGESZ) ?: -ENOENT);
 }
index 7952107a2db81d4ce9323353e977fd01aefbc006..31f2bd789e2dde01e1e43ce21d8eafdc414babc9 100644 (file)
@@ -636,7 +636,7 @@ int test_getdents64(const char *dir)
 
 static int test_getpagesize(void)
 {
-       long x = getpagesize();
+       int x = getpagesize();
        int c;
 
        if (x < 0)