Dmitry V. Levin | 85a364a | 2014-12-06 03:53:16 +0000 | [diff] [blame^] | 1 | #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 | |
| 14 | int |
| 15 | sys_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 | } |