blob: ef88b1ceba4636e35d0a1602bdb8043187e3161b [file] [log] [blame]
Dmitry V. Levin85a364a2014-12-06 03:53:16 +00001#include "defs.h"
2
3#include <sys/swap.h>
4
Dmitry V. Levin85a364a2014-12-06 03:53:16 +00005#include "xlat/swap_flags.h"
6
Dmitry V. Levina0bd3742015-04-07 01:36:50 +00007SYS_FUNC(swapon)
Dmitry V. Levin85a364a2014-12-06 03:53:16 +00008{
Dmitry V. Levinfcb94cd2016-04-07 01:15:58 +00009 unsigned int flags = tcp->u_arg[1];
10 unsigned int prio = flags & SWAP_FLAG_PRIO_MASK;
11 flags &= ~SWAP_FLAG_PRIO_MASK;
Dmitry V. Levin9afb4d02015-07-16 23:28:07 +000012
13 printpath(tcp, tcp->u_arg[0]);
14 tprints(", ");
Dmitry V. Levinfcb94cd2016-04-07 01:15:58 +000015 if (flags) {
16 printflags(swap_flags, flags, "SWAP_FLAG_???");
17 if (prio)
18 tprintf("|%u", prio);
19 } else {
20 tprintf("%u", prio);
21 }
Dmitry V. Levin9afb4d02015-07-16 23:28:07 +000022
23 return RVAL_DECODED;
Dmitry V. Levin85a364a2014-12-06 03:53:16 +000024}