blob: 25f82cb8d047eec6df9149d1ce893b5e134751b1 [file] [log] [blame]
#!/bin/sh
# Check how pread/pwrite and preadv/pwritev syscalls are traced.
. "${srcdir=.}/init.sh"
check_prog grep
check_prog rm
./uio ||
fail_ 'uio failed'
args="-edesc ./uio"
$STRACE $args > $LOG 2>&1 || {
cat $LOG
fail_ "$STRACE $args failed"
}
grep_log()
{
local syscall="$1"; shift
LC_ALL=C grep -E -x "$syscall$*" $LOG > /dev/null || {
cat $LOG
fail_ "$STRACE $args failed to trace \"$syscall\" properly"
}
}
grep_log 'pread(64)?' '\(3, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4'
grep_log 'preadv' '\(3, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4'
grep_log 'pwrite(64)?' '\(3, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4'
grep_log 'pwritev' '\(3, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4'
exit 0