[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230803-nolibc-warnings-v3-2-bcc1a096ae02@weissschuh.net>
Date: Thu, 03 Aug 2023 09:28:46 +0200
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Willy Tarreau <w@....eu>, Shuah Khan <shuah@...nel.org>
Cc: linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
Yuan Tan <tanyuan@...ylab.org>,
Zhangjin Wu <falcon@...ylab.org>,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH v3 02/14] tools/nolibc: fix return type of getpagesize()
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@...ssschuh.net>
---
tools/include/nolibc/sys.h | 4 ++--
tools/testing/selftests/nolibc/nolibc-test.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
index e12dd962c578..c151533ba8e9 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -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);
}
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 3a21bee360ea..52489455add8 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -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)
--
2.41.0
Powered by blists - more mailing lists