* tests/readlink.c: New file.
* tests/readlink.awk: Likewise.
* tests/readlinkat.c: Likewise.
* tests/readlinkat.awk: Likewise.
* tests/readlink.test: New test.
* tests/readlinkat.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add readlink and readlinkat.
(TESTS): Add readlink.test and readlinkat.test.
(EXTRA_DIST): Add readlink.awk and readlinkat.awk.
* tests/.gitignore: Add readlink and readlinkat.
pc
pipe
ppoll
+readlink
+readlinkat
sched_xetattr
scm_rights
seccomp
pc \
pipe \
ppoll \
+ readlink \
+ readlinkat \
sched_xetattr \
scm_rights \
seccomp \
ipc_msg.test \
ipc_shm.test \
ipc_sem.test \
+ readlink.test \
+ readlinkat.test \
sched_xetattr.test \
scm_rights-fd.test \
seccomp.test \
pipe.expected \
ppoll.expected \
ppoll-v.expected \
+ readlink.awk \
+ readlinkat.awk \
restart_syscall.expected \
restart_syscall_unknown.expected \
select.awk \
--- /dev/null
+BEGIN {
+ pathname = "\\\\x72\\\\x65\\\\x61\\\\x64\\\\x6c\\\\x69\\\\x6e\\\\x6b\\\\x2e\\\\x6c\\\\x69\\\\x6e\\\\x6b"
+ buf = "\\\\x72\\\\x65\\\\x61"
+ r[1] = "^readlink\\(\"" pathname "\", \"" buf "\"\\.\\.\\., 31\\) += 10"
+ r[2] = "^\\+\\+\\+ exited with 0 \\+\\+\\+$"
+ lines = 2
+ fail = 0
+}
+
+@include "match.awk"
--- /dev/null
+#include <unistd.h>
+#include <sys/syscall.h>
+
+int
+main(void)
+{
+#ifdef __NR_readlink
+ char buf[31];
+
+ if (syscall(__NR_readlink, "readlink.link", buf, sizeof(buf)) != 10)
+ return 77;
+
+ return 0;
+#else
+ return 77;
+#endif
+}
--- /dev/null
+#!/bin/sh
+
+# Check readlink syscall decoding.
+
+. "${srcdir=.}/init.sh"
+
+ln -sf readlink.c readlink.link ||
+ framework_skip_ 'failed to create a symlink'
+
+run_prog
+run_strace -e readlink -xx -s3 $args
+match_awk
+
+rm -f readlink.link
+
+exit 0
--- /dev/null
+BEGIN {
+ pathname = "\\\\x72\\\\x65\\\\x61\\\\x64\\\\x6c\\\\x69\\\\x6e\\\\x6b\\\\x61\\\\x74\\\\x2e\\\\x6c\\\\x69\\\\x6e\\\\x6b"
+ buf = "\\\\x72\\\\x65\\\\x61"
+ r[1] = "^readlinkat\\(AT_FDCWD, \"" pathname "\", \"" buf "\"\\.\\.\\., 31\\) += 12"
+ r[2] = "^\\+\\+\\+ exited with 0 \\+\\+\\+$"
+ lines = 2
+ fail = 0
+}
+
+@include "match.awk"
--- /dev/null
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/syscall.h>
+
+int
+main(void)
+{
+#ifdef __NR_readlinkat
+ char buf[31];
+
+ if (syscall(__NR_readlinkat, AT_FDCWD, "readlinkat.link", buf, sizeof(buf)) != 12)
+ return 77;
+
+ return 0;
+#else
+ return 77;
+#endif
+}
--- /dev/null
+#!/bin/sh
+
+# Check readlinkat syscall decoding.
+
+. "${srcdir=.}/init.sh"
+
+ln -sf readlinkat.c readlinkat.link ||
+ framework_skip_ 'failed to create a symlink'
+
+run_prog
+run_strace -e readlinkat -xx -s3 $args
+match_awk
+
+rm -f readlinkat.link
+
+exit 0