* configure.ac (AC_CHECK_FUNCS): Remove pipe2.
* tests/pipe.c: Include <asm/unistd.h>, skip the test if [!__NR_pipe]
instead of [!HAVE_PIPE2].
(main): Do not call pipe2.
* tests/pipe.test: Skip the test if libc pipe wrapper does not use
pipe syscall, rewrite from match_grep to match_diff.
* tests/pipe.expected: Update expected output.
futimens
if_indextoname
open64
- pipe2
prctl
preadv
process_vm_readv
/*
+ * Check decoding of pipe syscall.
+ *
* Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
*/
#include "tests.h"
+#include <asm/unistd.h>
-#ifdef HAVE_PIPE2
+#ifdef __NR_pipe
# include <stdio.h>
# include <fcntl.h>
{
(void) close(0);
(void) close(1);
- int fds[2];
+ int *const fds = tail_alloc(sizeof(*fds) * 2);
if (pipe(fds))
perror_msg_and_fail("pipe");
- (void) close(0);
- (void) close(1);
- if (pipe2(fds, O_NONBLOCK))
- perror_msg_and_skip("pipe2");
-
return 0;
}
#else
-SKIP_MAIN_UNDEFINED("HAVE_PIPE2")
+SKIP_MAIN_UNDEFINED("__NR_pipe")
#endif
-pipe(\(\[0, 1\]|2\(\[0, 1\], 0)\) += 0
-pipe2\(\[0, 1\], O_NONBLOCK\) += 0
+pipe([0, 1]) = 0
++++ exited with 0 +++
#!/bin/sh
-# Check pipe/pipe2 syscalls decoding.
-
+# Check decoding of pipe syscall.
. "${srcdir=.}/init.sh"
-syscall=pipe2
-for n in pipe; do
- $STRACE -e$n -h > /dev/null && syscall=$syscall,$n
-done
-
run_prog
-run_strace -e$syscall $args
-match_grep
+run_strace -a13 -epipe $args
+
+check_prog grep
+LC_ALL=C grep -x "pipe(.*" "$LOG" > /dev/null ||
+ skip_ 'test executable does not use pipe syscall'
-exit 0
+match_diff