2 * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
3 * Copyright (c) 2018-2019 The strace developers.
6 * SPDX-License-Identifier: GPL-2.0-or-later
12 #if defined __NR_select && defined __NR__newselect \
13 && __NR_select != __NR__newselect \
20 # include <sys/select.h>
22 static const char *errstr;
25 xselect(const kernel_ulong_t args)
27 static const kernel_ulong_t dummy = F8ILL_KULONG_MASK | 0xfacefeed;
28 long rc = syscall(__NR_select, args, dummy, dummy, dummy, dummy, dummy);
29 errstr = sprintrc(rc);
36 unsigned long *const args = tail_alloc(sizeof(*args) * 4);
37 memset(args, 0, sizeof(*args) * 4);
40 # ifndef PATH_TRACING_FD
41 printf("select(NULL) = %s\n", errstr);
44 xselect((uintptr_t) args);
45 # ifndef PATH_TRACING_FD
46 printf("select(%p) = %s\n", args, errstr);
49 puts("+++ exited with 0 +++");
55 SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect"
56 " && __NR_select != __NR__newselect"
57 " && !defined __sparc__")