Skip to content

Commit

Permalink
tools/nolibc: make sys_mmap() automatically use the right __NR_mmap d…
Browse files Browse the repository at this point in the history
…efinition

__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 <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
wtarreau authored and paulmckrcu committed Aug 31, 2022
1 parent 8b53e83 commit 364702f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/include/nolibc/sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 364702f

Please sign in to comment.