]> granicus.if.org Git - strace/blob - swapon.c
Show f_flags field in printstatfs
[strace] / swapon.c
1 #include "defs.h"
2
3 #include <sys/swap.h>
4
5 #ifndef SWAP_FLAG_PREFER
6 # define SWAP_FLAG_PREFER 0x8000
7 #endif
8 #ifndef SWAP_FLAG_DISCARD
9 # define SWAP_FLAG_DISCARD 0x10000
10 #endif
11 #ifndef SWAP_FLAG_DISCARD_ONCE
12 # define SWAP_FLAG_DISCARD_ONCE 0x20000
13 #endif
14 #ifndef SWAP_FLAG_DISCARD_PAGES
15 # define SWAP_FLAG_DISCARD_PAGES 0x40000
16 #endif
17
18 #include "xlat/swap_flags.h"
19
20 int
21 sys_swapon(struct tcb *tcp)
22 {
23         if (entering(tcp)) {
24                 int flags = tcp->u_arg[1];
25                 printpath(tcp, tcp->u_arg[0]);
26                 tprints(", ");
27                 printflags(swap_flags, flags & ~SWAP_FLAG_PRIO_MASK,
28                         "SWAP_FLAG_???");
29                 if (flags & SWAP_FLAG_PREFER)
30                         tprintf("|%d", flags & SWAP_FLAG_PRIO_MASK);
31         }
32         return 0;
33 }