1 /*
2 * Copyright (c) 2016-2019 The strace developers.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8 #include "tests.h"
9 #include "scno.h"
10
11 #if defined __NR_ipc && !defined __ARM_EABI__
12
13 # include "semop-common.c"
14
15 # define XLAT_MACROS_ONLY
16 # include "xlat/ipccalls.h"
17 # undef XLAT_MACROS_ONLY
18
19 static long
20 k_semop(const unsigned int semid,
21 const kernel_ulong_t sops,
22 const unsigned int nsops)
23 {
24 const kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL;
25 const kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL;
26 const kernel_ulong_t arg1 = fill | SEMOP;
27 const kernel_ulong_t arg2 = fill | semid;
28 const kernel_ulong_t arg3 = fill | nsops;
29 const kernel_ulong_t arg5 = sops;
30 const long rc = syscall(__NR_ipc, arg1, arg2, arg3, bad, arg5, bad);
31 errstr = sprintrc(rc);
32 return rc;
33 }
34
35 #else
36
37 SKIP_MAIN_UNDEFINED("__NR_ipc && !__ARM_EABI__")
38
39 #endif