* tests/times-fail.c: New file.
* tests/times-fail.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add times-fail.
(TESTS): Add times-fail.test.
* tests/.gitignore: Add times-fail.
sysinfo
time
times
+times-fail
uid
uid16
uid32
sysinfo \
time \
times \
+ times-fail \
uid \
uid16 \
uid32 \
sun_path.test \
time.test \
times.test \
+ times-fail.test \
umovestr.test \
umovestr2.test \
unix-yy.test \
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+int
+main (void)
+{
+ if (syscall(__NR_times, 0x42) != -1)
+ return 77;
+ puts("times(0x42) = -1 EFAULT (Bad address)");
+ puts("+++ exited with 0 +++");
+
+ return 0;
+}
--- /dev/null
+#!/bin/sh
+
+# Check decoding of failing times syscall
+
+. "${srcdir=.}/init.sh"
+
+run_prog > /dev/null
+OUT="$LOG.out"
+run_strace -a12 -etimes $args > "$OUT"
+match_diff "$OUT" "$LOG"
+rm -f "$OUT"
+
+exit 0