1 /*
2 * Test strace's -n option.
3 *
4 * Copyright (c) 2020-2021 The strace developers.
5 * All rights reserved.
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10 #include "tests.h"
11 #include "scno.h"
12
13 #include <stdio.h>
14 #include <unistd.h>
15 #include <errno.h>
16
17 #define SC_listen 4
18
19 int
20 main(void)
21 {
22 int rc;
23
24 #ifdef __NR_socketcall
25 if (syscall(__NR_socketcall, 0L, 0L, 0L, 0L, 0L) < 0
26 && EINVAL == errno)
27 {
28 const long args[] = { 0, 0 };
29 rc = syscall(__NR_socketcall, SC_listen, args);
30 printf("[%4u] listen(0, 0) = %s\n", __NR_socketcall, sprintrc(rc));
31 }
32 #endif
33
34 rc = syscall(__NR_listen, 0, 0);
35 printf("[%4u] listen(0, 0) = %s\n", __NR_listen, sprintrc(rc));
36
37 return 0;
38 }