diff options
author | Yuan Tan <[email protected]> | 2023-08-01 23:39:54 +0800 |
---|---|---|
committer | Willy Tarreau <[email protected]> | 2023-08-23 05:17:07 +0200 |
commit | 3ec38af6eedb1659f4a2b0350f61782952dd50b7 (patch) | |
tree | bcb709f0dde00a49628945d530c4a90eb5316abb /net/lapb/lapb_subr.c | |
parent | e7d0129df681aa23bb6528f44186accc38d655f0 (diff) |
tools/nolibc: add pipe() and pipe2() support
According to manual page [1], posix spec [2] and source code like
arch/mips/kernel/syscall.c, for historic reasons, the sys_pipe() syscall
on some architectures has an unusual calling convention. It returns
results in two registers which means there is no need for it to do
verify the validity of a userspace pointer argument. Historically that
used to be expensive in Linux. These days the performance advantage is
negligible.
Nolibc doesn't support the unusual calling convention above, luckily
Linux provides a generic sys_pipe2() with an additional flags argument
from 2.6.27. If flags is 0, then pipe2() is the same as pipe(). So here
we use sys_pipe2() to implement the pipe().
pipe2() is also provided to allow users to use flags argument on demand.
[1]: https://man7.org/linux/man-pages/man2/pipe.2.html
[2]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pipe.html
Suggested-by: Zhangjin Wu <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Yuan Tan <[email protected]>
Reviewed-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Willy Tarreau <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions