strace/swapon.c
Dmitry V. Levin 85a364a4ac file.c: move swapon parser to a separate file
* swapon.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c: Move sys_swapon and related code to swapon.c.
2014-12-11 21:37:52 +00:00

28 lines
513 B
C

#include "defs.h"
#include <sys/swap.h>
#ifndef SWAP_FLAG_PREFER
# define SWAP_FLAG_PREFER 0x8000
#endif
#ifndef SWAP_FLAG_DISCARD
# define SWAP_FLAG_DISCARD 0x10000
#endif
#include "xlat/swap_flags.h"
int
sys_swapon(struct tcb *tcp)
{
if (entering(tcp)) {
int flags = tcp->u_arg[1];
printpath(tcp, tcp->u_arg[0]);
tprints(", ");
printflags(swap_flags, flags & ~SWAP_FLAG_PRIO_MASK,
"SWAP_FLAG_???");
if (flags & SWAP_FLAG_PREFER)
tprintf("|%d", flags & SWAP_FLAG_PRIO_MASK);
}
return 0;
}