diff options
author | Zhangjin Wu | 2023-06-28 21:11:44 +0800 |
---|---|---|
committer | Willy Tarreau | 2023-08-06 12:27:53 +0200 |
commit | c8d54fa37c5390cfbb63f63900a2466469eafb3a (patch) | |
tree | f073c565132fce8eed746a8627e04e120d509e0e /tools/include | |
parent | 428905da6ec4a02d08dfcc09013035594f666a31 (diff) |
tools/nolibc: unistd.h: apply __sysret() helper
Use __sysret() to shrink the whole _syscall() to oneline code.
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/nolibc/unistd.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h index 0e832e10a0b2..fabc846f797b 100644 --- a/tools/include/nolibc/unistd.h +++ b/tools/include/nolibc/unistd.h @@ -56,16 +56,7 @@ int tcsetpgrp(int fd, pid_t pid) return ioctl(fd, TIOCSPGRP, &pid); } -#define _syscall(N, ...) \ -({ \ - long _ret = my_syscall##N(__VA_ARGS__); \ - if (_ret < 0) { \ - SET_ERRNO(-_ret); \ - _ret = -1; \ - } \ - _ret; \ -}) - +#define _syscall(N, ...) __sysret(my_syscall##N(__VA_ARGS__)) #define _syscall_narg(...) __syscall_narg(__VA_ARGS__, 6, 5, 4, 3, 2, 1, 0) #define __syscall_narg(_0, _1, _2, _3, _4, _5, _6, N, ...) N #define _syscall_n(N, ...) _syscall(N, __VA_ARGS__) |