From dfb7dac3af623a68262536437af008ed6aba4d88 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 30 Oct 2005 15:02:22 -0800 Subject: [PATCH] unify sys_ptrace prototype Make sure we always return, as all syscalls should. Also move the common prototype to Signed-off-by: Christoph Hellwig Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/arm/kernel/ptrace.c | 2 +- arch/arm26/kernel/ptrace.c | 2 +- arch/frv/kernel/ptrace.c | 2 +- arch/h8300/kernel/ptrace.c | 2 +- arch/i386/kernel/ptrace.c | 2 +- arch/ia64/ia32/sys_ia32.c | 1 + arch/m32r/kernel/ptrace.c | 2 +- arch/m68k/kernel/ptrace.c | 2 +- arch/m68knommu/kernel/ptrace.c | 2 +- arch/mips/kernel/ptrace.c | 2 +- arch/ppc/kernel/ptrace.c | 2 +- arch/ppc64/kernel/ptrace.c | 2 +- arch/sh/kernel/ptrace.c | 2 +- arch/sh64/kernel/ptrace.c | 2 +- arch/um/include/sysdep-i386/syscalls.h | 1 - arch/v850/kernel/ptrace.c | 2 +- arch/xtensa/kernel/ptrace.c | 2 +- include/asm-arm/unistd.h | 1 - include/asm-arm26/unistd.h | 1 - include/asm-cris/unistd.h | 1 - include/asm-h8300/unistd.h | 1 - include/asm-i386/unistd.h | 1 - include/asm-ia64/unistd.h | 2 -- include/asm-m32r/unistd.h | 1 - include/asm-m68k/unistd.h | 1 - include/asm-m68knommu/unistd.h | 1 - include/asm-mips/unistd.h | 1 - include/asm-ppc/unistd.h | 1 - include/asm-ppc64/unistd.h | 1 - include/asm-s390/unistd.h | 1 - include/asm-sh/unistd.h | 1 - include/asm-v850/unistd.h | 1 - include/asm-x86_64/unistd.h | 2 -- include/linux/syscalls.h | 1 + 34 files changed, 17 insertions(+), 34 deletions(-) diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index cd99b83f14c..9bd8609a292 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -782,7 +782,7 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat return ret; } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret; diff --git a/arch/arm26/kernel/ptrace.c b/arch/arm26/kernel/ptrace.c index 8a52124de0e..cf7e977d18c 100644 --- a/arch/arm26/kernel/ptrace.c +++ b/arch/arm26/kernel/ptrace.c @@ -665,7 +665,7 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat return ret; } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret; diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c index cbe03cba9f0..cb335a14a31 100644 --- a/arch/frv/kernel/ptrace.c +++ b/arch/frv/kernel/ptrace.c @@ -106,7 +106,7 @@ void ptrace_enable(struct task_struct *child) child->thread.frame0->__status |= REG__STATUS_STEP; } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; unsigned long tmp; diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c index 05c15e86977..a569fe4aa28 100644 --- a/arch/h8300/kernel/ptrace.c +++ b/arch/h8300/kernel/ptrace.c @@ -57,7 +57,7 @@ void ptrace_disable(struct task_struct *child) h8300_disable_trace(child); } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret; diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c index 7b6368bf897..efd11f09c99 100644 --- a/arch/i386/kernel/ptrace.c +++ b/arch/i386/kernel/ptrace.c @@ -354,7 +354,7 @@ ptrace_set_thread_area(struct task_struct *child, return 0; } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; struct user * dummy = NULL; diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index 3fa67ecebc8..dc282710421 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c index 124f7c1b775..078d2a0e71c 100644 --- a/arch/m32r/kernel/ptrace.c +++ b/arch/m32r/kernel/ptrace.c @@ -756,7 +756,7 @@ do_ptrace(long request, struct task_struct *child, long addr, long data) return ret; } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret; diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c index 8ed1b01a6a8..f7f1d2e5b90 100644 --- a/arch/m68k/kernel/ptrace.c +++ b/arch/m68k/kernel/ptrace.c @@ -121,7 +121,7 @@ void ptrace_disable(struct task_struct *child) child->thread.work.syscall_trace = 0; } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; unsigned long tmp; diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c index 9724e1cd82e..621d7b91ccf 100644 --- a/arch/m68knommu/kernel/ptrace.c +++ b/arch/m68knommu/kernel/ptrace.c @@ -101,7 +101,7 @@ void ptrace_disable(struct task_struct *child) put_reg(child, PT_SR, tmp); } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret; diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index fcceab8f2e0..f1b0f3e1f95 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -174,7 +174,7 @@ int ptrace_setfpregs (struct task_struct *child, __u32 __user *data) return 0; } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret; diff --git a/arch/ppc/kernel/ptrace.c b/arch/ppc/kernel/ptrace.c index e7aee4108de..e2744b6879d 100644 --- a/arch/ppc/kernel/ptrace.c +++ b/arch/ppc/kernel/ptrace.c @@ -240,7 +240,7 @@ void ptrace_disable(struct task_struct *child) clear_single_step(child); } -int sys_ptrace(long request, long pid, long addr, long data) +long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret = -EPERM; diff --git a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c index b1c044ca575..b33073c3172 100644 --- a/arch/ppc64/kernel/ptrace.c +++ b/arch/ppc64/kernel/ptrace.c @@ -53,7 +53,7 @@ void ptrace_disable(struct task_struct *child) clear_single_step(child); } -int sys_ptrace(long request, long pid, long addr, long data) +long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret = -EPERM; diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c index b28919b6568..1fbe5a428e3 100644 --- a/arch/sh/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace.c @@ -80,7 +80,7 @@ void ptrace_disable(struct task_struct *child) /* nothing to do.. */ } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; struct user * dummy = NULL; diff --git a/arch/sh64/kernel/ptrace.c b/arch/sh64/kernel/ptrace.c index fd2000956da..71f2eec00b9 100644 --- a/arch/sh64/kernel/ptrace.c +++ b/arch/sh64/kernel/ptrace.c @@ -121,7 +121,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data) return 0; } -asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; extern void poke_real_address_q(unsigned long long addr, unsigned long long data); diff --git a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h index a0d5b74d373..57bd79efbee 100644 --- a/arch/um/include/sysdep-i386/syscalls.h +++ b/arch/um/include/sysdep-i386/syscalls.h @@ -11,7 +11,6 @@ typedef long syscall_handler_t(struct pt_regs); /* Not declared on x86, incompatible declarations on x86_64, so these have * to go here rather than in sys_call_table.c */ -extern syscall_handler_t sys_ptrace; extern syscall_handler_t sys_rt_sigaction; extern syscall_handler_t old_mmap_i386; diff --git a/arch/v850/kernel/ptrace.c b/arch/v850/kernel/ptrace.c index 4726b87f5e5..d6077ff47d2 100644 --- a/arch/v850/kernel/ptrace.c +++ b/arch/v850/kernel/ptrace.c @@ -113,7 +113,7 @@ static int set_single_step (struct task_struct *t, int val) return 1; } -int sys_ptrace(long request, long pid, long addr, long data) +long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int rval; diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index 2659efdd4e9..14460743de0 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c @@ -45,7 +45,7 @@ void ptrace_disable(struct task_struct *child) /* Nothing to do.. */ } -int sys_ptrace(long request, long pid, long addr, long data) +long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int ret = -EPERM; diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index c49df635a80..d626e70fade 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h @@ -544,7 +544,6 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, asmlinkage int sys_fork(struct pt_regs *regs); asmlinkage int sys_vfork(struct pt_regs *regs); asmlinkage int sys_pipe(unsigned long *fildes); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-arm26/unistd.h b/include/asm-arm26/unistd.h index dfa0b0c30aa..be4c2fb9c04 100644 --- a/include/asm-arm26/unistd.h +++ b/include/asm-arm26/unistd.h @@ -480,7 +480,6 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, asmlinkage int sys_fork(struct pt_regs *regs); asmlinkage int sys_vfork(struct pt_regs *regs); asmlinkage int sys_pipe(unsigned long *fildes); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h index 28232ad2ff3..156a34bfc58 100644 --- a/include/asm-cris/unistd.h +++ b/include/asm-cris/unistd.h @@ -367,7 +367,6 @@ asmlinkage int sys_fork(long r10, long r11, long r12, long r13, asmlinkage int sys_vfork(long r10, long r11, long r12, long r13, long mof, long srp, struct pt_regs *regs); asmlinkage int sys_pipe(unsigned long __user *fildes); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h index 56a6401886f..56a4a5686c8 100644 --- a/include/asm-h8300/unistd.h +++ b/include/asm-h8300/unistd.h @@ -528,7 +528,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, asmlinkage int sys_execve(char *name, char **argv, char **envp, int dummy, ...); asmlinkage int sys_pipe(unsigned long *fildes); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index fbaf90a3968..0f92e78dfea 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h @@ -448,7 +448,6 @@ asmlinkage int sys_clone(struct pt_regs regs); asmlinkage int sys_fork(struct pt_regs regs); asmlinkage int sys_vfork(struct pt_regs regs); asmlinkage int sys_pipe(unsigned long __user *fildes); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); asmlinkage long sys_iopl(unsigned long unused); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index 3a0c6952465..6d96a67439b 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h @@ -383,8 +383,6 @@ struct sigaction; long sys_execve(char __user *filename, char __user * __user *argv, char __user * __user *envp, struct pt_regs *regs); asmlinkage long sys_pipe(void); -asmlinkage long sys_ptrace(long request, pid_t pid, - unsigned long addr, unsigned long data); asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, struct sigaction __user *oact, diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h index 8552d8f45ab..ac399e1f7bc 100644 --- a/include/asm-m32r/unistd.h +++ b/include/asm-m32r/unistd.h @@ -452,7 +452,6 @@ asmlinkage int sys_clone(struct pt_regs regs); asmlinkage int sys_fork(struct pt_regs regs); asmlinkage int sys_vfork(struct pt_regs regs); asmlinkage int sys_pipe(unsigned long __user *fildes); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h index cbabde4f8a4..c2554bcd174 100644 --- a/include/asm-m68k/unistd.h +++ b/include/asm-m68k/unistd.h @@ -444,7 +444,6 @@ asmlinkage long sys_mmap2( unsigned long fd, unsigned long pgoff); asmlinkage int sys_execve(char *name, char **argv, char **envp); asmlinkage int sys_pipe(unsigned long *fildes); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); struct pt_regs; struct sigaction; asmlinkage long sys_rt_sigaction(int sig, diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h index 84b6fa14459..5373988a7e5 100644 --- a/include/asm-m68knommu/unistd.h +++ b/include/asm-m68knommu/unistd.h @@ -504,7 +504,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long fd, unsigned long pgoff); asmlinkage int sys_execve(char *name, char **argv, char **envp); asmlinkage int sys_pipe(unsigned long *fildes); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); struct pt_regs; int sys_request_irq(unsigned int, irqreturn_t (*)(int, void *, struct pt_regs *), diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index c9eaf4c104d..89ea8b60e94 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h @@ -1177,7 +1177,6 @@ asmlinkage long sys_mmap2( unsigned long fd, unsigned long pgoff); asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs); asmlinkage int sys_pipe(nabi_no_regargs struct pt_regs regs); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h index 3173ab3d2eb..404c143e643 100644 --- a/include/asm-ppc/unistd.h +++ b/include/asm-ppc/unistd.h @@ -469,7 +469,6 @@ int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6, int sys_vfork(int p1, int p2, int p3, int p4, int p5, int p6, struct pt_regs *regs); int sys_pipe(int __user *fildes); -int sys_ptrace(long request, long pid, long addr, long data); struct sigaction; long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-ppc64/unistd.h b/include/asm-ppc64/unistd.h index 977bc980c1a..6b5fcbadbc5 100644 --- a/include/asm-ppc64/unistd.h +++ b/include/asm-ppc64/unistd.h @@ -467,7 +467,6 @@ int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, unsigned long p4, unsigned long p5, unsigned long p6, struct pt_regs *regs); int sys_pipe(int __user *fildes); -int sys_ptrace(long request, long pid, long addr, long data); struct sigaction; long sys_rt_sigaction(int sig, const struct sigaction __user *act, struct sigaction __user *oact, size_t sigsetsize); diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index 221e965da92..f97d92691f1 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h @@ -590,7 +590,6 @@ asmlinkage long sys_clone(struct pt_regs regs); asmlinkage long sys_fork(struct pt_regs regs); asmlinkage long sys_vfork(struct pt_regs regs); asmlinkage long sys_pipe(unsigned long __user *fildes); -asmlinkage long sys_ptrace(long request, long pid, long addr, long data); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index ea89e8f223e..f2c8e14d1fd 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h @@ -503,7 +503,6 @@ asmlinkage int sys_vfork(unsigned long r4, unsigned long r5, asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs regs); -asmlinkage int sys_ptrace(long request, long pid, long addr, long data); asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char *buf, size_t count, long dummy, loff_t pos); asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char *buf, diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h index 3b552096c0e..5a86f8e976e 100644 --- a/include/asm-v850/unistd.h +++ b/include/asm-v850/unistd.h @@ -452,7 +452,6 @@ unsigned long sys_mmap2(unsigned long addr, size_t len, struct pt_regs; int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs); int sys_pipe (int *fildes); -int sys_ptrace(long request, long pid, long addr, long data); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index 11ba931cf82..3c494b65d33 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h @@ -780,8 +780,6 @@ asmlinkage long sys_pipe(int *fildes); #include #include -asmlinkage long sys_ptrace(long request, long pid, - unsigned long addr, long data); asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs); asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on); struct sigaction; diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a6f03e47373..c7007b1db91 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -491,6 +491,7 @@ asmlinkage long sys_nfsservctl(int cmd, asmlinkage long sys_syslog(int type, char __user *buf, int len); asmlinkage long sys_uselib(const char __user *library); asmlinkage long sys_ni_syscall(void); +asmlinkage long sys_ptrace(long request, long pid, long addr, long data); asmlinkage long sys_add_key(const char __user *_type, const char __user *_description, -- cgit v1.2.3-70-g09d2