blob: c26bb061d684b91841d126dc16de7098d858096c [file] [log] [blame]
Dmitry V. Levin85a364a2014-12-06 03:53:16 +00001#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
12#include "xlat/swap_flags.h"
13
14int
15sys_swapon(struct tcb *tcp)
16{
17 if (entering(tcp)) {
18 int flags = tcp->u_arg[1];
19 printpath(tcp, tcp->u_arg[0]);
20 tprints(", ");
21 printflags(swap_flags, flags & ~SWAP_FLAG_PRIO_MASK,
22 "SWAP_FLAG_???");
23 if (flags & SWAP_FLAG_PREFER)
24 tprintf("|%d", flags & SWAP_FLAG_PRIO_MASK);
25 }
26 return 0;
27}