From: Mike Frysinger Date: Mon, 11 Aug 2014 06:52:08 +0000 (-0400) Subject: tests: fix uio building w/out preadv/pwritev X-Git-Tag: v4.9~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97ca0277b3380ec4e30220fbfa32a9f4d3aa6961;p=strace tests: fix uio building w/out preadv/pwritev The preadv/pwritev symbols weren't added to glibc until the 2.10 release, so trying to build the uio test leads to link failures. Add configure tests and update uio.test to handle this. * configure.ac (AC_CHECK_FUNCS): Add preadv/pwritev. * tests/uio.c: Include config.h. (main): Check for HAVE_PREADV and HAVE_PWRITEV. * tests/uio.test: Check exit status of uio helper. --- diff --git a/configure.ac b/configure.ac index 9aeb3a69..054f85be 100644 --- a/configure.ac +++ b/configure.ac @@ -214,7 +214,9 @@ AC_CHECK_FUNCS(m4_normalize([ if_indextoname inet_ntop prctl + preadv process_vm_readv + pwritev sendmsg sigaction stpcpy diff --git a/tests/uio.c b/tests/uio.c index ca731e03..aac123a6 100644 --- a/tests/uio.c +++ b/tests/uio.c @@ -1,3 +1,6 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include #include #include @@ -6,6 +9,7 @@ int main(void) { +#if defined(HAVE_PREADV) && defined(HAVE_PWRITEV) const off_t offset = 0xdefaceddeadbeefLL; int fd; char buf[4]; @@ -22,4 +26,7 @@ main(void) assert(!close(fd)); return 0; +#else + return 77; +#endif } diff --git a/tests/uio.test b/tests/uio.test index 25f82cb8..313761f5 100755 --- a/tests/uio.test +++ b/tests/uio.test @@ -7,8 +7,13 @@ check_prog grep check_prog rm -./uio || - fail_ 'uio failed' +./uio || { + if [ $? -eq 77 ]; then + framework_skip_ 'preadv/pwritev syscalls are not available' + else + fail_ 'uio failed' + fi +} args="-edesc ./uio" $STRACE $args > $LOG 2>&1 || {