From: Willy Tarreau Date: Tue, 19 Jul 2022 21:44:34 +0000 (+0200) Subject: tools/nolibc: make sys_mmap() automatically use the right __NR_mmap definition X-Git-Tag: v6.1-rc1~210^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=364702f7551451f2fab341f1b31adf911c888375;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Paul E. McKenney --- diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index b8c96878c9ce0..ce3ee03aa6794 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