check_PROGRAMS = net-accept-connect set_ptracer_any sigaction
-TESTS = ptrace_setoptions strace-f qual_syscall sigaction.sh stat net \
- detach-sleeping detach-stopped detach-running
+TESTS = \
+ ptrace_setoptions.test \
+ strace-f.test \
+ qual_syscall.test \
+ sigaction.test \
+ stat.test \
+ net.test \
+ detach-sleeping.test \
+ detach-stopped.test \
+ detach-running.test
-LOG_COMPILER = $(srcdir)/run.sh
+TEST_LOG_COMPILER = $(srcdir)/run.sh
EXTRA_DIST = init.sh run.sh sigaction.awk $(TESTS)
+++ /dev/null
-#!/bin/sh
-
-# Ensure that strace can detach from running processes.
-
-. "${srcdir=.}/init.sh"
-
-check_prog sleep
-check_prog grep
-
-set -e
-
-./set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null &
-
-while ! [ -s $LOG ]; do
- kill -0 $! 2> /dev/null ||
- fail_ 'set_ptracer_any sh failed'
- $SLEEP_A_BIT
-done
-
-tracee_pid=$!
-
-cleanup()
-{
- set +e
- kill $tracee_pid
- wait $tracee_pid 2> /dev/null
-}
-
-rm -f $LOG
-$STRACE -p $tracee_pid 2> $LOG &
-
-while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do
- kill -0 $! 2> /dev/null ||
- { cat $LOG; cleanup; fail_ 'strace -p does not work'; }
- $SLEEP_A_BIT
-done
-
-kill -INT $!
-wait $!
-
-grep -F "Process $tracee_pid detached" $LOG > /dev/null ||
- { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; }
-
-if [ -f /proc/self/status ]; then
- $SLEEP_A_BIT
- test -d /proc/$tracee_pid ||
- { cat $LOG; cleanup; fail_ 'tracee died after detach'; }
- grep '^State:.*R (running)' < /proc/$tracee_pid/status > /dev/null || {
- cat $LOG
- grep '^State:' < /proc/$tracee_pid/status
- cleanup
- fail_ 'tracee is not running after detach'
- }
-fi
-
-cleanup
-exit 0
--- /dev/null
+#!/bin/sh
+
+# Ensure that strace can detach from running processes.
+
+. "${srcdir=.}/init.sh"
+
+check_prog sleep
+check_prog grep
+
+set -e
+
+./set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null &
+
+while ! [ -s $LOG ]; do
+ kill -0 $! 2> /dev/null ||
+ fail_ 'set_ptracer_any sh failed'
+ $SLEEP_A_BIT
+done
+
+tracee_pid=$!
+
+cleanup()
+{
+ set +e
+ kill $tracee_pid
+ wait $tracee_pid 2> /dev/null
+}
+
+rm -f $LOG
+$STRACE -p $tracee_pid 2> $LOG &
+
+while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do
+ kill -0 $! 2> /dev/null ||
+ { cat $LOG; cleanup; fail_ 'strace -p does not work'; }
+ $SLEEP_A_BIT
+done
+
+kill -INT $!
+wait $!
+
+grep -F "Process $tracee_pid detached" $LOG > /dev/null ||
+ { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; }
+
+if [ -f /proc/self/status ]; then
+ $SLEEP_A_BIT
+ test -d /proc/$tracee_pid ||
+ { cat $LOG; cleanup; fail_ 'tracee died after detach'; }
+ grep '^State:.*R (running)' < /proc/$tracee_pid/status > /dev/null || {
+ cat $LOG
+ grep '^State:' < /proc/$tracee_pid/status
+ cleanup
+ fail_ 'tracee is not running after detach'
+ }
+fi
+
+cleanup
+exit 0
+++ /dev/null
-#!/bin/sh
-
-# Ensure that strace can detach from sleeping processes.
-
-. "${srcdir=.}/init.sh"
-
-check_prog sleep
-check_prog grep
-
-set -e
-
-rm -f $LOG
-./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > $LOG &
-
-while ! [ -s $LOG ]; do
- kill -0 $! 2> /dev/null ||
- fail_ 'set_ptracer_any sleep failed'
- $SLEEP_A_BIT
-done
-
-tracee_pid=$!
-
-cleanup()
-{
- set +e
- kill $tracee_pid
- wait $tracee_pid 2> /dev/null
-}
-
-rm -f $LOG
-$STRACE -p $tracee_pid 2> $LOG &
-
-while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do
- kill -0 $! 2> /dev/null ||
- { cat $LOG; cleanup; fail_ 'strace -p does not work'; }
- $SLEEP_A_BIT
-done
-
-kill -INT $!
-wait $!
-
-grep -F "Process $tracee_pid detached" $LOG > /dev/null ||
- { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; }
-
-if [ -f /proc/self/status ]; then
- $SLEEP_A_BIT
- test -d /proc/$tracee_pid ||
- { cat $LOG; cleanup; fail_ 'tracee died after detach'; }
- grep '^State:.*S (sleeping)' < /proc/$tracee_pid/status > /dev/null || {
- cat $LOG
- grep '^State:' < /proc/$tracee_pid/status
- cleanup
- fail_ 'tracee is not sleeping after detach'
- }
-fi
-
-cleanup
-exit 0
--- /dev/null
+#!/bin/sh
+
+# Ensure that strace can detach from sleeping processes.
+
+. "${srcdir=.}/init.sh"
+
+check_prog sleep
+check_prog grep
+
+set -e
+
+rm -f $LOG
+./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > $LOG &
+
+while ! [ -s $LOG ]; do
+ kill -0 $! 2> /dev/null ||
+ fail_ 'set_ptracer_any sleep failed'
+ $SLEEP_A_BIT
+done
+
+tracee_pid=$!
+
+cleanup()
+{
+ set +e
+ kill $tracee_pid
+ wait $tracee_pid 2> /dev/null
+}
+
+rm -f $LOG
+$STRACE -p $tracee_pid 2> $LOG &
+
+while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do
+ kill -0 $! 2> /dev/null ||
+ { cat $LOG; cleanup; fail_ 'strace -p does not work'; }
+ $SLEEP_A_BIT
+done
+
+kill -INT $!
+wait $!
+
+grep -F "Process $tracee_pid detached" $LOG > /dev/null ||
+ { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; }
+
+if [ -f /proc/self/status ]; then
+ $SLEEP_A_BIT
+ test -d /proc/$tracee_pid ||
+ { cat $LOG; cleanup; fail_ 'tracee died after detach'; }
+ grep '^State:.*S (sleeping)' < /proc/$tracee_pid/status > /dev/null || {
+ cat $LOG
+ grep '^State:' < /proc/$tracee_pid/status
+ cleanup
+ fail_ 'tracee is not sleeping after detach'
+ }
+fi
+
+cleanup
+exit 0
+++ /dev/null
-#!/bin/sh
-
-# Ensure that strace can detach from stopped processes.
-
-. "${srcdir=.}/init.sh"
-
-check_prog sleep
-check_prog grep
-
-set -e
-
-rm -f $LOG
-./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > $LOG &
-
-while ! [ -s $LOG ]; do
- kill -0 $! 2> /dev/null ||
- fail_ 'set_ptracer_any sleep failed'
- $SLEEP_A_BIT
-done
-
-tracee_pid=$!
-kill -STOP $tracee_pid
-
-cleanup()
-{
- set +e
- kill $tracee_pid
- kill -CONT $tracee_pid
- wait $tracee_pid 2> /dev/null
-}
-
-rm -f $LOG
-$STRACE -p $tracee_pid 2> $LOG &
-
-while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do
- kill -0 $! 2> /dev/null ||
- { cat $LOG; cleanup; fail_ 'strace -p does not work'; }
- $SLEEP_A_BIT
-done
-
-while ! grep -F -e '--- stopped by ' $LOG > /dev/null; do
- kill -0 $! 2> /dev/null ||
- { cat $LOG; cleanup; fail_ 'strace -p does not work'; }
- $SLEEP_A_BIT
-done
-
-kill -INT $!
-wait $!
-
-grep -F "Process $tracee_pid detached" $LOG > /dev/null ||
- { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; }
-
-if [ -f /proc/self/status ]; then
- $SLEEP_A_BIT
- test -d /proc/$tracee_pid ||
- { cat $LOG; cleanup; fail_ 'tracee died after detach'; }
- grep '^State:.*T (stopped)' < /proc/$tracee_pid/status > /dev/null || {
- cat $LOG
- grep '^State:' < /proc/$tracee_pid/status
- cleanup
- fail_ 'tracee is not group-stopped after detach'
- }
-fi
-
-cleanup
-exit 0
--- /dev/null
+#!/bin/sh
+
+# Ensure that strace can detach from stopped processes.
+
+. "${srcdir=.}/init.sh"
+
+check_prog sleep
+check_prog grep
+
+set -e
+
+rm -f $LOG
+./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > $LOG &
+
+while ! [ -s $LOG ]; do
+ kill -0 $! 2> /dev/null ||
+ fail_ 'set_ptracer_any sleep failed'
+ $SLEEP_A_BIT
+done
+
+tracee_pid=$!
+kill -STOP $tracee_pid
+
+cleanup()
+{
+ set +e
+ kill $tracee_pid
+ kill -CONT $tracee_pid
+ wait $tracee_pid 2> /dev/null
+}
+
+rm -f $LOG
+$STRACE -p $tracee_pid 2> $LOG &
+
+while ! grep -F "Process $tracee_pid attached" $LOG > /dev/null; do
+ kill -0 $! 2> /dev/null ||
+ { cat $LOG; cleanup; fail_ 'strace -p does not work'; }
+ $SLEEP_A_BIT
+done
+
+while ! grep -F -e '--- stopped by ' $LOG > /dev/null; do
+ kill -0 $! 2> /dev/null ||
+ { cat $LOG; cleanup; fail_ 'strace -p does not work'; }
+ $SLEEP_A_BIT
+done
+
+kill -INT $!
+wait $!
+
+grep -F "Process $tracee_pid detached" $LOG > /dev/null ||
+ { cat $LOG; cleanup; fail_ 'strace -p failed to detach'; }
+
+if [ -f /proc/self/status ]; then
+ $SLEEP_A_BIT
+ test -d /proc/$tracee_pid ||
+ { cat $LOG; cleanup; fail_ 'tracee died after detach'; }
+ grep '^State:.*T (stopped)' < /proc/$tracee_pid/status > /dev/null || {
+ cat $LOG
+ grep '^State:' < /proc/$tracee_pid/status
+ cleanup
+ fail_ 'tracee is not group-stopped after detach'
+ }
+fi
+
+cleanup
+exit 0
+++ /dev/null
-#!/bin/sh
-
-# Check how network syscalls are traced.
-
-. "${srcdir=.}/init.sh"
-
-check_prog grep
-check_prog rm
-
-rm -f $LOG.*
-
-./net-accept-connect ||
- fail_ 'net-accept-connect failed'
-
-args="-tt -ff -o $LOG -enetwork ./net-accept-connect"
-$STRACE $args ||
- fail_ "strace $args failed"
-
-"$srcdir"/../strace-log-merge $LOG > $LOG || {
- cat $LOG
- fail_ 'strace-log-merge failed'
-}
-
-rm -f $LOG.*
-
-grep_log()
-{
- local syscall="$1"; shift
- local prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +'
-
- LC_ALL=C grep -E -x "$prefix$syscall$@" $LOG > /dev/null || {
- cat $LOG
- fail_ "strace -enetwork failed to trace \"$syscall\" properly"
- }
-}
-
-grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 0'
-grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 1'
-grep_log bind '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0'
-grep_log listen '\(0, 5\) += 0'
-grep_log getsockname '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, \[15\]\) += 0'
-grep_log accept '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), NULL\}, \[2\]\) += 1'
-grep_log connect '\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0'
-
-exit 0
--- /dev/null
+#!/bin/sh
+
+# Check how network syscalls are traced.
+
+. "${srcdir=.}/init.sh"
+
+check_prog grep
+check_prog rm
+
+rm -f $LOG.*
+
+./net-accept-connect ||
+ fail_ 'net-accept-connect failed'
+
+args="-tt -ff -o $LOG -enetwork ./net-accept-connect"
+$STRACE $args ||
+ fail_ "strace $args failed"
+
+"$srcdir"/../strace-log-merge $LOG > $LOG || {
+ cat $LOG
+ fail_ 'strace-log-merge failed'
+}
+
+rm -f $LOG.*
+
+grep_log()
+{
+ local syscall="$1"; shift
+ local prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +'
+
+ LC_ALL=C grep -E -x "$prefix$syscall$@" $LOG > /dev/null || {
+ cat $LOG
+ fail_ "strace -enetwork failed to trace \"$syscall\" properly"
+ }
+}
+
+grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 0'
+grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 1'
+grep_log bind '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0'
+grep_log listen '\(0, 5\) += 0'
+grep_log getsockname '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, \[15\]\) += 0'
+grep_log accept '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), NULL\}, \[2\]\) += 1'
+grep_log connect '\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0'
+
+exit 0
+++ /dev/null
-#!/bin/sh
-
-# Ensure that strace tests kernel PTRACE_O_TRACECLONE
-# and PTRACE_O_TRACESYSGOOD support properly.
-
-. "${srcdir=.}/init.sh"
-
-[ "$(uname -s)" = Linux ] ||
- skip_ 'The kernel is not a Linux kernel'
-case "$(uname -r)" in
- 2.[6-9]*|2.[1-5][0-9]*|[3-9].*|[12][0-9]*) ;;
- *) skip_ 'The kernel is not Linux 2.6.* or newer' ;;
-esac
-
-$STRACE -df -enone / > /dev/null 2> $LOG
-grep -F -x 'ptrace_setoptions = 0xe' $LOG > /dev/null || {
- cat $LOG
- fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACECLONE support'
-}
-
-grep -F -x 'ptrace_setoptions = 0x1f' $LOG > /dev/null || {
- cat $LOG
- fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support'
-}
-
-$STRACE -d -enone / > /dev/null 2> $LOG
-grep -F -x 'ptrace_setoptions = 0x11' $LOG > /dev/null || {
- cat $LOG
- fail_ 'strace failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support'
-}
--- /dev/null
+#!/bin/sh
+
+# Ensure that strace tests kernel PTRACE_O_TRACECLONE
+# and PTRACE_O_TRACESYSGOOD support properly.
+
+. "${srcdir=.}/init.sh"
+
+[ "$(uname -s)" = Linux ] ||
+ skip_ 'The kernel is not a Linux kernel'
+case "$(uname -r)" in
+ 2.[6-9]*|2.[1-5][0-9]*|[3-9].*|[12][0-9]*) ;;
+ *) skip_ 'The kernel is not Linux 2.6.* or newer' ;;
+esac
+
+$STRACE -df -enone / > /dev/null 2> $LOG
+grep -F -x 'ptrace_setoptions = 0xe' $LOG > /dev/null || {
+ cat $LOG
+ fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACECLONE support'
+}
+
+grep -F -x 'ptrace_setoptions = 0x1f' $LOG > /dev/null || {
+ cat $LOG
+ fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support'
+}
+
+$STRACE -d -enone / > /dev/null 2> $LOG
+grep -F -x 'ptrace_setoptions = 0x11' $LOG > /dev/null || {
+ cat $LOG
+ fail_ 'strace failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support'
+}
+++ /dev/null
-#!/bin/sh
-
-# Ensure that strace -e trace=set works.
-
-. "${srcdir=.}/init.sh"
-
-check_prog ls
-check_prog grep
-
-$STRACE -e execve ls > /dev/null 2> $LOG &&
-grep '^execve(' $LOG > /dev/null ||
- { cat $LOG; fail_ 'strace -e execve does not work'; }
-
-grep -v '^execve(' $LOG |
-LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null &&
- { cat $LOG; fail_ 'strace -e execve does not work properly'; }
-
-$STRACE -e trace=process ls > /dev/null 2> $LOG &&
-grep '^execve(' $LOG > /dev/null ||
- { cat $LOG; fail_ 'strace -e trace=process does not work'; }
-
-grep '^open' $LOG > /dev/null &&
- { cat $LOG; fail_ 'strace -e trace=process does not work properly'; }
-
-exit 0
--- /dev/null
+#!/bin/sh
+
+# Ensure that strace -e trace=set works.
+
+. "${srcdir=.}/init.sh"
+
+check_prog ls
+check_prog grep
+
+$STRACE -e execve ls > /dev/null 2> $LOG &&
+grep '^execve(' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -e execve does not work'; }
+
+grep -v '^execve(' $LOG |
+LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null &&
+ { cat $LOG; fail_ 'strace -e execve does not work properly'; }
+
+$STRACE -e trace=process ls > /dev/null 2> $LOG &&
+grep '^execve(' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -e trace=process does not work'; }
+
+grep '^open' $LOG > /dev/null &&
+ { cat $LOG; fail_ 'strace -e trace=process does not work properly'; }
+
+exit 0
+++ /dev/null
-#!/bin/sh
-
-# Check rt_sigaction decoding.
-
-. "${srcdir=.}/init.sh"
-
-check_prog awk
-
-./sigaction ||
- fail_ 'sigaction failed'
-
-args="-o $LOG -ert_sigaction ./sigaction"
-$STRACE $args ||
- fail_ "strace $args failed"
-
-awk -f "$srcdir"/sigaction.awk $LOG ||
- { cat $LOG; fail_ 'unexpected output'; }
-
-exit 0
--- /dev/null
+#!/bin/sh
+
+# Check rt_sigaction decoding.
+
+. "${srcdir=.}/init.sh"
+
+check_prog awk
+
+./sigaction ||
+ fail_ 'sigaction failed'
+
+args="-o $LOG -ert_sigaction ./sigaction"
+$STRACE $args ||
+ fail_ "strace $args failed"
+
+awk -f "$srcdir"/sigaction.awk $LOG ||
+ { cat $LOG; fail_ 'unexpected output'; }
+
+exit 0
+++ /dev/null
-#!/bin/sh
-
-# Check how ftruncate, lseek and stat family syscalls are traced.
-
-. "${srcdir=.}/init.sh"
-
-check_prog dd
-check_prog find
-check_prog grep
-check_prog rm
-
-umask 022
-truncate_cmd='dd seek=46118400000 obs=1 count=0 if=/dev/null of=sample'
-$truncate_cmd > $LOG 2>&1 ||
- { cat $LOG; framework_skip_ 'failed to create a large sparse file'; }
-rm -f sample
-
-$STRACE -edesc $truncate_cmd 2>&1 > /dev/null 2> $LOG &&
-LC_ALL=C grep -E -x 'ftruncate(64)?\(1, 46118400000\) += 0' $LOG > /dev/null ||
- { cat $LOG; fail_ 'strace -edesc failed to trace ftruncate/ftruncate64 properly'; }
-
-LC_ALL=C grep -E -x 'lseek\(1, 46118400000, SEEK_CUR\) += 46118400000|_llseek\(1, 46118400000, \[46118400000\], SEEK_CUR\) += 0' $LOG > /dev/null ||
- { cat $LOG; fail_ 'strace -edesc failed to trace lseek/_llseek properly'; }
-
-$STRACE -efile find -L sample > /dev/null 2> $LOG &&
-LC_ALL=C grep -E -x 'stat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, 0\) += 0' $LOG > /dev/null ||
- { cat $LOG; fail_ 'strace -efile failed to trace stat/stat64 properly'; }
-
-$STRACE -efile find sample > /dev/null 2> $LOG &&
-LC_ALL=C grep -E -x 'lstat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, AT_SYMLINK_NOFOLLOW\) += 0' $LOG > /dev/null ||
- { cat $LOG; fail_ 'strace -efile failed to trace fstatat/fstatat64 properly'; }
-
-rm -f sample
-
-exit 0
--- /dev/null
+#!/bin/sh
+
+# Check how ftruncate, lseek and stat family syscalls are traced.
+
+. "${srcdir=.}/init.sh"
+
+check_prog dd
+check_prog find
+check_prog grep
+check_prog rm
+
+umask 022
+truncate_cmd='dd seek=46118400000 obs=1 count=0 if=/dev/null of=sample'
+$truncate_cmd > $LOG 2>&1 ||
+ { cat $LOG; framework_skip_ 'failed to create a large sparse file'; }
+rm -f sample
+
+$STRACE -edesc $truncate_cmd 2>&1 > /dev/null 2> $LOG &&
+LC_ALL=C grep -E -x 'ftruncate(64)?\(1, 46118400000\) += 0' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -edesc failed to trace ftruncate/ftruncate64 properly'; }
+
+LC_ALL=C grep -E -x 'lseek\(1, 46118400000, SEEK_CUR\) += 46118400000|_llseek\(1, 46118400000, \[46118400000\], SEEK_CUR\) += 0' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -edesc failed to trace lseek/_llseek properly'; }
+
+$STRACE -efile find -L sample > /dev/null 2> $LOG &&
+LC_ALL=C grep -E -x 'stat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, 0\) += 0' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -efile failed to trace stat/stat64 properly'; }
+
+$STRACE -efile find sample > /dev/null 2> $LOG &&
+LC_ALL=C grep -E -x 'lstat(64)?\("sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}\) += 0|(new)?fstatat(64)?\(AT_FDCWD, "sample", \{st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.\}, AT_SYMLINK_NOFOLLOW\) += 0' $LOG > /dev/null ||
+ { cat $LOG; fail_ 'strace -efile failed to trace fstatat/fstatat64 properly'; }
+
+rm -f sample
+
+exit 0
+++ /dev/null
-#!/bin/sh
-
-# Ensure that strace -f works.
-
-. "${srcdir=.}/init.sh"
-
-time=/usr/bin/time
-check_prog $time
-
-$STRACE -f $time /bin/ls > $LOG 2>&1 ||
- { cat $LOG; fail_ 'strace -f does not work'; }
--- /dev/null
+#!/bin/sh
+
+# Ensure that strace -f works.
+
+. "${srcdir=.}/init.sh"
+
+time=/usr/bin/time
+check_prog $time
+
+$STRACE -f $time /bin/ls > $LOG 2>&1 ||
+ { cat $LOG; fail_ 'strace -f does not work'; }