]> granicus.if.org Git - strace/commitdiff
tests: check decoding of shutdown syscall
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 18 Jul 2016 23:39:18 +0000 (23:39 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 19 Jul 2016 17:46:33 +0000 (17:46 +0000)
* tests/shutdown.c: New file.
* tests/shutdown.test: New test.
* tests/.gitignore: Add shutdown.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add shutdown.test.

tests/.gitignore
tests/Makefile.am
tests/shutdown.c [new file with mode: 0644]
tests/shutdown.test [new file with mode: 0755]

index 06651bd89f0f08bcb9f8a7a46687c5e49e05a3c5..cf262bd49130a0eb866c1ba95a44c858a90f660a 100644 (file)
@@ -242,6 +242,7 @@ setrlimit
 setuid
 setuid32
 shmxt
+shutdown
 sigaction
 sigaltstack
 siginfo
index 59825de89841fea2f9e207adebbf6e9790426981..d507495d9360f4035fd34eef213e33086f490010 100644 (file)
@@ -298,6 +298,7 @@ check_PROGRAMS = \
        setuid \
        setuid32 \
        shmxt \
+       shutdown \
        sigaction \
        sigaltstack \
        siginfo \
@@ -617,6 +618,7 @@ DECODER_TESTS = \
        setuid.test \
        setuid32.test \
        shmxt.test \
+       shutdown.test \
        sigaction.test \
        sigaltstack.test \
        siginfo.test \
diff --git a/tests/shutdown.c b/tests/shutdown.c
new file mode 100644 (file)
index 0000000..d770c43
--- /dev/null
@@ -0,0 +1,15 @@
+/* Check decoding of shutdown syscall. */
+
+#include "tests.h"
+#include <stdio.h>
+#include <sys/socket.h>
+
+int
+main(void)
+{
+       int rc = shutdown(-1, SHUT_RDWR);
+       printf("shutdown(-1, SHUT_RDWR) = %d %s (%m)\n", rc, errno2name());
+
+       puts("+++ exited with 0 +++");
+       return 0;
+}
diff --git a/tests/shutdown.test b/tests/shutdown.test
new file mode 100755 (executable)
index 0000000..22f0d5a
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check decoding of shutdown syscall.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a24