]> granicus.if.org Git - strace/commitdiff
tests: check decoding of accept4 syscall
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 11 Jul 2016 17:21:22 +0000 (17:21 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 12 Jul 2016 14:42:30 +0000 (14:42 +0000)
* configure.ac (AC_CHECK_FUNCS): Add accept4.
* tests/accept4.c: New file.
* tests/accept4.test: New test.
* tests/.gitignore: Add accept4.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add accept4.test.

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

index 97b75be7564bf853feb2569f37f6a16485a6a002..f70a7bdd0ee226d3afc738aca13c8e2db472c610 100644 (file)
@@ -282,6 +282,7 @@ AC_HEADER_STDBOOL
 AC_HEADER_STDC
 
 AC_CHECK_FUNCS(m4_normalize([
+       accept4
        fanotify_mark
        fopen64
        fork
index 02327dd56c98f47e748f82a99d5f7c3bc56124b1..ac0c1b6da7436d7b614cbc5f19caebc26a454e77 100644 (file)
@@ -7,6 +7,7 @@
 *.trs
 _newselect
 accept
+accept4
 access
 acct
 adjtimex
index 4c10f8adb795675ef248112da719470d1531bfc5..fc09d1ea2cc6cdb5e8a9b7ee603d62c853a35754 100644 (file)
@@ -63,6 +63,7 @@ LDADD = libtests.a
 check_PROGRAMS = \
        _newselect \
        accept \
+       accept4 \
        access \
        acct \
        adjtimex \
@@ -385,6 +386,7 @@ endif
 DECODER_TESTS = \
        _newselect.test \
        accept.test \
+       accept4.test \
        access.test \
        acct.test \
        adjtimex.test \
diff --git a/tests/accept4.c b/tests/accept4.c
new file mode 100644 (file)
index 0000000..d49eb24
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Check decoding of accept4 syscall.
+ *
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+
+#ifdef HAVE_ACCEPT4
+
+# define TEST_SYSCALL_NAME accept4
+# define SUFFIX_ARGS , SOCK_CLOEXEC
+# define SUFFIX_STR ", SOCK_CLOEXEC"
+# include "accept.c"
+
+#else
+
+SKIP_MAIN_UNDEFINED("HAVE_ACCEPT4")
+
+#endif
diff --git a/tests/accept4.test b/tests/accept4.test
new file mode 100755 (executable)
index 0000000..722f25a
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check decoding of accept4 syscall.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a37