Eliminate native_scno and known_scno
* defs.h (known_scno): Remove. (sysent): Remove native_scno field. * process.c [IA64]: Replace known_scno(tcp) with tcp->scno. (internal_fork) [USE_PROCFS || !LINUX]: Likewise. * syscall.c: Do not define NR_SYSCALL_BASE. (known_scno): Remove. (syscall_fixup_on_sysenter) [USE_PROCFS]: Replace known_scno(tcp) with tcp->scno. (trace_syscall_entering) [SVR4 || FREEBSD || SUNOS4]: Likewise. (syscall_fixup_on_sysexit) [SUNOS4]: Likewise.
This commit is contained in:
parent
0c661513e5
commit
44824b9d4b
2
defs.h
2
defs.h
@ -610,7 +610,6 @@ extern void qualify(const char *);
|
||||
#ifdef USE_PROCFS
|
||||
extern int get_scno(struct tcb *);
|
||||
#endif
|
||||
extern long known_scno(struct tcb *);
|
||||
extern long do_ptrace(int request, struct tcb *tcp, void *addr, void *data);
|
||||
extern int ptrace_restart(int request, struct tcb *tcp, int sig);
|
||||
extern int trace_syscall(struct tcb *);
|
||||
@ -742,7 +741,6 @@ struct sysent {
|
||||
int sys_flags;
|
||||
int (*sys_func)();
|
||||
const char *sys_name;
|
||||
long native_scno; /* Match against SYS_* constants. */
|
||||
};
|
||||
|
||||
struct ioctlent {
|
||||
|
12
process.c
12
process.c
@ -475,7 +475,7 @@ internal_fork(struct tcb *tcp)
|
||||
|
||||
if (exiting(tcp)) {
|
||||
#ifdef SYS_rfork
|
||||
if (known_scno(tcp) == SYS_rfork && !(tcp->u_arg[0]&RFPROC))
|
||||
if (tcp->scno == SYS_rfork && !(tcp->u_arg[0]&RFPROC))
|
||||
return 0;
|
||||
#endif
|
||||
if (getrval2(tcp))
|
||||
@ -562,10 +562,10 @@ extern void print_ldt_entry();
|
||||
# if defined IA64
|
||||
# define ARG_FLAGS 0
|
||||
# define ARG_STACK 1
|
||||
# define ARG_STACKSIZE (known_scno(tcp) == SYS_clone2 ? 2 : -1)
|
||||
# define ARG_PTID (known_scno(tcp) == SYS_clone2 ? 3 : 2)
|
||||
# define ARG_CTID (known_scno(tcp) == SYS_clone2 ? 4 : 3)
|
||||
# define ARG_TLS (known_scno(tcp) == SYS_clone2 ? 5 : 4)
|
||||
# define ARG_STACKSIZE (tcp->scno == SYS_clone2 ? 2 : -1)
|
||||
# define ARG_PTID (tcp->scno == SYS_clone2 ? 3 : 2)
|
||||
# define ARG_CTID (tcp->scno == SYS_clone2 ? 4 : 3)
|
||||
# define ARG_TLS (tcp->scno == SYS_clone2 ? 5 : 4)
|
||||
# elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
|
||||
# define ARG_STACK 0
|
||||
# define ARG_FLAGS 1
|
||||
@ -802,7 +802,7 @@ internal_fork(struct tcb *tcp)
|
||||
int dont_follow = 0;
|
||||
|
||||
#ifdef SYS_vfork
|
||||
if (known_scno(tcp) == SYS_vfork) {
|
||||
if (tcp->scno == SYS_vfork) {
|
||||
/* Attempt to make vfork into fork, which we can follow. */
|
||||
if (change_syscall(tcp, SYS_fork) < 0)
|
||||
dont_follow = 1;
|
||||
|
22
syscall.c
22
syscall.c
@ -72,7 +72,6 @@
|
||||
# include <asm/rse.h>
|
||||
#endif
|
||||
|
||||
#define NR_SYSCALL_BASE 0
|
||||
#ifdef LINUX
|
||||
#ifndef ERESTARTSYS
|
||||
#define ERESTARTSYS 512
|
||||
@ -97,8 +96,6 @@
|
||||
/* Ugh. Is this really correct? ARM has no RT signals?! */
|
||||
#undef NSIG
|
||||
#define NSIG 32
|
||||
#undef NR_SYSCALL_BASE
|
||||
#define NR_SYSCALL_BASE __NR_SYSCALL_BASE
|
||||
#endif
|
||||
#endif /* LINUX */
|
||||
|
||||
@ -1226,19 +1223,6 @@ get_scno(struct tcb *tcp)
|
||||
return 1;
|
||||
}
|
||||
|
||||
long
|
||||
known_scno(struct tcb *tcp)
|
||||
{
|
||||
long scno = tcp->scno;
|
||||
#if SUPPORTED_PERSONALITIES > 1
|
||||
if (SCNO_IN_RANGE(scno) && sysent[scno].native_scno != 0)
|
||||
scno = sysent[scno].native_scno;
|
||||
else
|
||||
#endif
|
||||
scno += NR_SYSCALL_BASE;
|
||||
return scno;
|
||||
}
|
||||
|
||||
/* Called at each syscall entry.
|
||||
* Returns:
|
||||
* 0: "ignore this ptrace stop", bail out of trace_syscall() silently.
|
||||
@ -1250,7 +1234,7 @@ static int
|
||||
syscall_fixup_on_sysenter(struct tcb *tcp)
|
||||
{
|
||||
#ifdef USE_PROCFS
|
||||
int scno = known_scno(tcp);
|
||||
int scno = tcp->scno;
|
||||
|
||||
if (tcp->status.PR_WHY != PR_SYSENTRY) {
|
||||
if (
|
||||
@ -1754,7 +1738,7 @@ trace_syscall_entering(struct tcb *tcp)
|
||||
#endif /* SYS_socket_subcall || SYS_ipc_subcall */
|
||||
|
||||
#if defined(SVR4) || defined(FREEBSD) || defined(SUNOS4)
|
||||
switch (known_scno(tcp)) {
|
||||
switch (tcp->scno) {
|
||||
#ifdef SVR4
|
||||
#ifdef SYS_pgrpsys_subcall
|
||||
case SYS_pgrpsys:
|
||||
@ -2002,7 +1986,7 @@ syscall_fixup_on_sysexit(struct tcb *tcp)
|
||||
|
||||
#ifdef SUNOS4
|
||||
{
|
||||
int scno = known_scno(tcp);
|
||||
int scno = tcp->scno;
|
||||
if (scno != 0) {
|
||||
if (debug) {
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user