]> granicus.if.org Git - strace/blob - swapon.c
tests: add support of multi-line diagnostics to check_h
[strace] / swapon.c
1 /*
2  * Copyright (c) 2014-2018 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         printpath(tcp, tcp->u_arg[0]);
21         tprints(", ");
22         if (flags) {
23                 printflags(swap_flags, flags, "SWAP_FLAG_???");
24                 tprintf("|%u", prio);
25         } else {
26                 tprintf("%u", prio);
27         }
28
29         return RVAL_DECODED;
30 }