blob: 4006d9629b5132a471b4faae0d4cb7185e4d1f6c [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
Dmitry V. Levina0bd3742015-04-07 01:36:50 +000020SYS_FUNC(swapon)
Dmitry V. Levin85a364a2014-12-06 03:53:16 +000021{
22 if (entering(tcp)) {
23 int flags = tcp->u_arg[1];
24 printpath(tcp, tcp->u_arg[0]);
25 tprints(", ");
26 printflags(swap_flags, flags & ~SWAP_FLAG_PRIO_MASK,
27 "SWAP_FLAG_???");
28 if (flags & SWAP_FLAG_PREFER)
29 tprintf("|%d", flags & SWAP_FLAG_PRIO_MASK);
30 }
31 return 0;
32}