From: Dmitry V. Levin Date: Mon, 11 Jul 2016 17:21:22 +0000 (+0000) Subject: tests: check decoding of accept4 syscall X-Git-Tag: v4.13~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=891855edd9096b50807925aba813b5294df7e4d9;p=strace tests: check decoding of accept4 syscall * 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. --- diff --git a/configure.ac b/configure.ac index 97b75be7..f70a7bdd 100644 --- a/configure.ac +++ b/configure.ac @@ -282,6 +282,7 @@ AC_HEADER_STDBOOL AC_HEADER_STDC AC_CHECK_FUNCS(m4_normalize([ + accept4 fanotify_mark fopen64 fork diff --git a/tests/.gitignore b/tests/.gitignore index 02327dd5..ac0c1b6d 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -7,6 +7,7 @@ *.trs _newselect accept +accept4 access acct adjtimex diff --git a/tests/Makefile.am b/tests/Makefile.am index 4c10f8ad..fc09d1ea 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 00000000..d49eb244 --- /dev/null +++ b/tests/accept4.c @@ -0,0 +1,43 @@ +/* + * Check decoding of accept4 syscall. + * + * Copyright (c) 2016 Dmitry V. Levin + * 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 index 00000000..722f25a5 --- /dev/null +++ b/tests/accept4.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check decoding of accept4 syscall. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37