Dmitry V. Levin | 85a364a | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
| 3 | #include <sys/swap.h> |
| 4 | |
Dmitry V. Levin | 85a364a | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 5 | #include "xlat/swap_flags.h" |
| 6 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 7 | SYS_FUNC(swapon) |
Dmitry V. Levin | 85a364a | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 8 | { |
Dmitry V. Levin | fcb94cd | 2016-04-07 01:15:58 +0000 | [diff] [blame] | 9 | unsigned int flags = tcp->u_arg[1]; |
| 10 | unsigned int prio = flags & SWAP_FLAG_PRIO_MASK; |
| 11 | flags &= ~SWAP_FLAG_PRIO_MASK; |
Dmitry V. Levin | 9afb4d0 | 2015-07-16 23:28:07 +0000 | [diff] [blame] | 12 | |
| 13 | printpath(tcp, tcp->u_arg[0]); |
| 14 | tprints(", "); |
Dmitry V. Levin | fcb94cd | 2016-04-07 01:15:58 +0000 | [diff] [blame] | 15 | 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. Levin | 9afb4d0 | 2015-07-16 23:28:07 +0000 | [diff] [blame] | 22 | |
| 23 | return RVAL_DECODED; |
Dmitry V. Levin | 85a364a | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 24 | } |