diff options
| author | oech3 <79379754+oech3@users.noreply.github.com> | 2026-03-23 22:28:22 +0900 |
|---|---|---|
| committer | Pádraig Brady <P@draigBrady.com> | 2026-03-24 20:35:01 +0000 |
| commit | c495cbcfe2edbf03b46a96e16d4498b6ba4e7be0 (patch) | |
| tree | a5a82f401a56bbe945043c914f7fd7d96cb21d45 | |
| parent | 430822d5f71ff95bc813ddc254d559d808177d57 (diff) | |
| download | coreutils-c495cbcfe2edbf03b46a96e16d4498b6ba4e7be0.tar.gz coreutils-c495cbcfe2edbf03b46a96e16d4498b6ba4e7be0.zip | |
tests: yes: support more zero-copy related syscalls
* tests/misc/yes.sh: Disable other related zero-copy syscalls
to ensure better testing of future or other implementations.
https://github.com/coreutils/coreutils/pull/227
| -rwxr-xr-x | tests/misc/yes.sh | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/misc/yes.sh b/tests/misc/yes.sh index 56d89a36a..a31001b7b 100755 --- a/tests/misc/yes.sh +++ b/tests/misc/yes.sh @@ -63,10 +63,19 @@ if timeout 10 true; then test $? = 124 || fail=1 fi -# Ensure we fallback to write() if there is an issue with vmsplice -no_vmsplice() { strace -f -o /dev/null -e inject=vmsplice:error=ENOSYS "$@"; } -if no_vmsplice true; then - test "$(no_vmsplice yes | head -n2 | paste -s -d '')" = 'yy' || fail=1 +# Ensure we fallback to write() if there is an issue with (async) zero-copy +zc_syscalls='io_uring_setup io_uring_enter io_uring_register memfd_create + sendfile splice tee vmsplice' +syscalls=$( + for s in $zc_syscalls; do + strace -qe "$s" true >/dev/null 2>&1 && echo "$s" + done | paste -s -d,) + +no_zero_copy() { + strace -f -o /dev/null -e inject=${syscalls}:error=ENOSYS "$@" +} +if no_zero_copy true; then + test "$(no_zero_copy yes | head -n2 | paste -s -d '')" = 'yy' || fail=1 fi # Ensure we fallback to write() if there is an issue with pipe2() # For example if we don't have enough file descriptors available. |
