[PATCH] tests/stat: support fstatat syscall for stat()

Chris Metcalf cmetcalf at tilera.com
Mon May 6 15:21:13 UTC 2013

Newer Linux architectures don't support the stat/stat64 syscalls.
Instead they use fstatat() with AT_FDCWD and an extra flags argument.
Support seeing this output in the 'strace -efile' test.

Signed-off-by: Chris Metcalf <cmetcalf at tilera.com>
Note that the two strace -efiles tests ("find" and "find -L") actually
produce the same strace output on such platforms (other than seeing
the NOFOLLOW flag in one case).  I'm not sure making all the "AT_FDCWD",
etc., stuff explicit in the regexp really makes the most sense or not,
but it seemed closest to the spirit of the original regexp code.

 tests/stat |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/stat b/tests/stat
index 5fe0b86..3f006a2 100755
--- a/tests/stat
+++ b/tests/stat
@@ -27,7 +27,7 @@ LC_ALL=C grep -x 'lseek(1, 46118400000, SEEK_CUR) \+= 46118400000\|_llseek(1, 46
 timeout -s 9 $check_timeout \
 $STRACE -efile find -L sample > /dev/null 2> check.log &&
-LC_ALL=C grep -x 'stat\(64\)\?("sample", {st_mode=S_IFREG|0644, st_size=46118400000, \.\.\.}) \+= 0' check.log > /dev/null ||
+LC_ALL=C grep -x 'f\?stat\(at\)\?\(64\)\?(\(AT_FDCWD, \)\?"sample", {st_mode=S_IFREG|0644, st_size=46118400000, \.\.\.}\(, 0\)\?) \+= 0' check.log > /dev/null ||
 	{ cat check.log; fail_ 'strace -efile failed to trace stat/stat64 properly'; }
 timeout -s 9 $check_timeout \

More information about the Strace-devel mailing list