summaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2022-07-19 23:44:34 +0200
committerPaul E. McKenney <paulmck@kernel.org>2022-08-31 05:17:43 -0700
commit364702f7551451f2fab341f1b31adf911c888375 (patch)
treeb95af4692406f5ac8bb535ab5b1f6d8fd302f941 /tools/include
parent8b53e83b08cfdc3f430b5415cd1031d5e7e1f935 (diff)
downloadlinux-stable-364702f7551451f2fab341f1b31adf911c888375.tar.gz
linux-stable-364702f7551451f2fab341f1b31adf911c888375.tar.bz2
linux-stable-364702f7551451f2fab341f1b31adf911c888375.zip
tools/nolibc: make sys_mmap() automatically use the right __NR_mmap definition
__NR_mmap2 was used for i386 but it's also needed for other archs such as RISCV32 or ARM. Let's decide to use it based on the __NR_mmap2 definition as it's not defined on other archs. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/nolibc/sys.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
index b8c96878c9ce..ce3ee03aa679 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -697,7 +697,7 @@ void *sys_mmap(void *addr, size_t length, int prot, int flags, int fd,
int n;
-#if defined(__i386__)
+#if defined(__NR_mmap2)
n = __NR_mmap2;
offset >>= 12;
#else