Skip to content
Commit 924e9539 authored by @wuzhangjin's avatar @wuzhangjin Committed by Willy Tarreau
Browse files

tools/nolibc: clean up mmap() routine



Do several cleanups together:

- Since all supported architectures have my_syscall6() now, remove the
  #ifdef check.

- Move the mmap() related macros to tools/include/nolibc/types.h and
  reuse most of them from <linux/mman.h>

- Apply the new generic __sysret() to convert the calling of sys_map()
  to oneline code

Note, since MAP_FAILED is -1 on Linux, so we can use the generic
__sysret() which returns -1 upon error and still satisfy user land that
checks for MAP_FAILED.

Suggested-by: default avatarWilly Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/lkml/20230702192347.GJ16233@1wt.eu/


Signed-off-by: default avatarZhangjin Wu <falcon@tinylab.org>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 6591be4a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment