Wrap all syscalls in a kernel style return value
Add new syscall wrapper functions:
1) `uring_mmap`
2) `uring_munmap`
3) `uring_madvise`
4) `uring_getrlimit`
5) `uring_setrlimit`
All of them are `static inline`.
Use them to wrap the syscalls in a kernel style return value. The
main purpose of this change is to make it possible to remove the
dependency of `errno` variable in liburing C sources, so that later
we can support build without libc.
Extra new helpers:
1) `ERR_PTR()`
2) `PTR_ERR()`
3) `IS_ERR()`
These helpers are used to deal with syscalls that return a pointer.
Currently only `uring_mmap()` that depends on these.
Link: https://github.com/axboe/liburing/issues/443#issuecomment-927873932
Cc: Bedirhan KURT <windowz414@gnuweeb.org>
Suggested-by: Louvian Lyndal <louvianlyndal@gmail.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id>
Link: https://lore.kernel.org/r/20211003153428.369258-4-ammar.faizi@students.amikom.ac.id
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 files changed