diff options
| author | Zhangjin Wu <[email protected]> | 2023-06-28 21:08:32 +0800 |
|---|---|---|
| committer | Willy Tarreau <[email protected]> | 2023-08-06 12:27:53 +0200 |
| commit | 428905da6ec4a02d08dfcc09013035594f666a31 (patch) | |
| tree | 482ca414d932f5a87f8b2c483a2ca7135718f96e /tools/perf/scripts/python | |
| parent | 2f98aca8aaef0fca36adff5c478af1788997debd (diff) | |
tools/nolibc: sys.h: add a syscall return helper
Most of the library routines share the same syscall return logic:
In general, a 0 return value indicates success. A -1 return value
indicates an error, and an error number is stored in errno. [1]
Let's add a __sysret() helper for the above logic to simplify the coding
and shrink the code lines too.
Thomas suggested to use inline function instead of macro for __sysret().
Willy suggested to make __sysret() be always inline.
[1]: https://man7.org/linux/man-pages/man2/syscall.2.html
Suggested-by: Willy Tarreau <[email protected]>
Link: https://lore.kernel.org/linux-riscv/[email protected]/
Suggested-by: Thomas Weißschuh <[email protected]>
Link: https://lore.kernel.org/linux-riscv/[email protected]/
Reviewed-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Zhangjin Wu <[email protected]>
Signed-off-by: Willy Tarreau <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions