From d95eaefb4553ea6ba67dabfb3c5a8a5c59760bbf Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 18 Jul 2016 23:39:18 +0000 Subject: [PATCH] tests: check decoding of shutdown syscall * 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 | 1 + tests/Makefile.am | 2 ++ tests/shutdown.c | 15 +++++++++++++++ tests/shutdown.test | 6 ++++++ 4 files changed, 24 insertions(+) create mode 100644 tests/shutdown.c create mode 100755 tests/shutdown.test diff --git a/tests/.gitignore b/tests/.gitignore index 06651bd8..cf262bd4 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -242,6 +242,7 @@ setrlimit setuid setuid32 shmxt +shutdown sigaction sigaltstack siginfo diff --git a/tests/Makefile.am b/tests/Makefile.am index 59825de8..d507495d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 00000000..d770c43a --- /dev/null +++ b/tests/shutdown.c @@ -0,0 +1,15 @@ +/* Check decoding of shutdown syscall. */ + +#include "tests.h" +#include +#include + +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 index 00000000..22f0d5ab --- /dev/null +++ b/tests/shutdown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of shutdown syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -- 2.40.0