1 /*
2 * Copyright (c) 2014-2022 The strace developers.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7
8 #include "defs.h"
9
10 #include <sys/swap.h>
11
12 #include "xlat/swap_flags.h"
13
14 SYS_FUNC(swapon)
15 {
16 unsigned int flags = tcp->u_arg[1];
17 unsigned int prio = flags & SWAP_FLAG_PRIO_MASK;
18 flags &= ~SWAP_FLAG_PRIO_MASK;
19
20 /* path */
21 printpath(tcp, tcp->u_arg[0]);
22 tprint_arg_next();
23
24 /* swapflags */
25 tprint_flags_begin();
26 if (flags) {
27 printflags_in(swap_flags, flags, "SWAP_FLAG_???");
28 tprint_flags_or();
29 }
30 PRINT_VAL_U(prio);
31 tprint_flags_end();
32
33 return RVAL_DECODED;
34 }