2 * Check decoding of pipe2 syscall.
4 * Copyright (c) 2015-2017 Dmitry V. Levin <ldv@altlinux.org>
7 * SPDX-License-Identifier: GPL-2.0-or-later
11 #include <asm/unistd.h>
22 int *const fds = tail_alloc(sizeof(*fds) * 2);
23 int *const efault = fds + 1;
26 rc = syscall(__NR_pipe2, fds, F8ILL_KULONG_MASK | O_NONBLOCK);
28 perror_msg_and_skip("pipe2");
29 printf("pipe2([%d, %d], O_NONBLOCK) = 0\n", fds[0], fds[1]);
31 rc = syscall(__NR_pipe2, efault, F8ILL_KULONG_MASK);
32 printf("pipe2(%p, 0) = %s\n", efault, sprintrc(rc));
34 if (F8ILL_KULONG_SUPPORTED) {
35 const kernel_ulong_t ill = f8ill_ptr_to_kulong(fds);
36 rc = syscall(__NR_pipe2, ill, 0);
37 printf("pipe2(%#llx, 0) = %s\n",
38 (unsigned long long) ill, sprintrc(rc));
41 puts("+++ exited with 0 +++");
47 SKIP_MAIN_UNDEFINED("__NR_pipe2")