swapon: decode swap flags
* file.c: Include <sys/swap.h>. (swap_flags): New xlat structure. (sys_swapon): New function. * linux/dummy.h (sys_swapon): Remove. * linux/syscall.h (sys_swapon): New declaration.
This commit is contained in:
parent
37ab4b79de
commit
8829365654
22
file.c
22
file.c
@ -33,6 +33,7 @@
|
||||
#include "defs.h"
|
||||
|
||||
#include <dirent.h>
|
||||
#include <sys/swap.h>
|
||||
|
||||
struct kernel_dirent {
|
||||
unsigned long d_ino;
|
||||
@ -2694,3 +2695,24 @@ sys_fallocate(struct tcb *tcp)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct xlat swap_flags[] = {
|
||||
{ SWAP_FLAG_PREFER, "SWAP_FLAG_PREFER" },
|
||||
{ SWAP_FLAG_DISCARD, "SWAP_FLAG_DISCARD" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -91,7 +91,6 @@
|
||||
#define sys_rmdir sys_chdir
|
||||
#define sys_sched_get_priority_max sys_sched_get_priority_min
|
||||
#define sys_swapoff sys_chdir
|
||||
#define sys_swapon sys_chdir
|
||||
#define sys_symlink sys_link
|
||||
#define sys_syncfs sys_close
|
||||
#define sys_umount sys_chdir
|
||||
|
@ -259,6 +259,7 @@ int sys_stat64();
|
||||
int sys_statfs();
|
||||
int sys_statfs64();
|
||||
int sys_stime();
|
||||
int sys_swapon();
|
||||
int sys_symlinkat();
|
||||
int sys_sysctl();
|
||||
int sys_sysinfo();
|
||||
|
Loading…
x
Reference in New Issue
Block a user