blob: 8200a9b5d00588896309dd4af2354c3dcf050183 [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
Dmitry V. Levin825b5242014-12-13 01:34:47 +000011#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
Dmitry V. Levin85a364a2014-12-06 03:53:16 +000017
18#include "xlat/swap_flags.h"
19
20int
21sys_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}