From 13fd22ad0df5b80c428d3ecc0114fb340f3b3894 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 18 Aug 2025 22:18:58 -0700
Subject: [PATCH] Ignore pwritev/pwrite64 tests on musl

musl uses wrappers for pwritev and pwrite64 using
pwritev2 syscall [1], however the test exepcts that the
program will call pwritev and pwrite64 ( glibc behavior )

This can be fixed if the function calls are changed to
use syscall() API directly, but that needs change upstream [2]

Issue is reported upstream [3]

[1] https://git.musl-libc.org/cgit/musl/commit/src?id=5370070fded61b569196764673a4fc8440aac79e
[2] https://github.com/strace/strace/pull/347
[3] https://github.com/strace/strace/issues/349

Upstream-Status: Inappropriate [Musl Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 tests/pread64-pwrite64.gen.test | 2 ++
 tests/preadv-pwritev.gen.test   | 2 ++
 tests/pwritev.gen.test          | 2 ++
 3 files changed, 6 insertions(+)

--- a/tests/pread64-pwrite64.gen.test
+++ b/tests/pread64-pwrite64.gen.test
@@ -1,4 +1,7 @@
 #!/bin/sh -efu
 # Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pread64-pwrite64 -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null); do not edit.
 . "${srcdir=.}/init.sh"
+
+skip_ "Test not ported to musl, musl generates pwritev2"
+
 run_strace_match_diff -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null
--- a/tests/preadv-pwritev.gen.test
+++ b/tests/preadv-pwritev.gen.test
@@ -1,4 +1,7 @@
 #!/bin/sh -efu
 # Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv-pwritev -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev); do not edit.
 . "${srcdir=.}/init.sh"
+
+skip_ "Test not ported to musl, musl generates pwritev2"
+
 run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev
--- a/tests/pwritev.gen.test
+++ b/tests/pwritev.gen.test
@@ -1,4 +1,7 @@
 #!/bin/sh -efu
 # Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pwritev -a22 -s7); do not edit.
 . "${srcdir=.}/init.sh"
+
+skip_ "Test not ported to musl, musl generates pwritev2"
+
 run_strace_match_diff -a22 -s7
