Move personality parser to a separate file

* personality.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* system.c: Move sys_personality and related code to personality.c.
This commit is contained in:
Дмитрий Левин 2014-12-03 21:06:11 +00:00
parent b21e2fb059
commit d28b6a0264
3 changed files with 14 additions and 14 deletions

View File

@ -41,6 +41,7 @@ strace_SOURCES = \
net.c \
or1k_atomic.c \
pathtrace.c \
personality.c \
process.c \
ptp.c \
quota.c \

13
personality.c Normal file
View File

@ -0,0 +1,13 @@
#include "defs.h"
#include <linux/personality.h>
#include "xlat/personality_options.h"
int
sys_personality(struct tcb *tcp)
{
if (entering(tcp))
printxval(personality_options, tcp->u_arg[0], "PER_???");
return 0;
}

View File

@ -60,8 +60,6 @@
#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number */
#define MS_MGC_MSK 0xffff0000 /* Magic flag mask */
#include <linux/personality.h>
#include "xlat/mount_flags.h"
int
@ -119,15 +117,3 @@ sys_umount2(struct tcb *tcp)
}
return 0;
}
/* These are not macros, but enums. We just copy the values by hand
from Linux 2.6.9 here. */
#include "xlat/personality_options.h"
int
sys_personality(struct tcb *tcp)
{
if (entering(tcp))
printxval(personality_options, tcp->u_arg[0], "PER_???");
return 0;
}