- UML 64-bit cleanups in the system calls
Subsystems (2)
PATCH 1/11 - UML 64-bit cleanups in the system calls
[ The beginning of a series of 11 patches, the signal ones bang heavily on the same code, so merging will be much more pleasant if they are applied in order ]
64-bit cleanup - this fixes the return values of the system calls to be longs.
Signed-off-by Jeff Dike <[email protected]>
arch/um/include/syscall_user.h +1 -1
@@ -7,7 +7,7 @@#define __SYSCALL_USER_Hextern int record_syscall_start (int syscall); -extern void record_syscall_end (int index,int result); +extern void record_syscall_end (int index,long result);#endif
arch/um/kernel/exec_kern.c +8 -8
@@ -34,9 +34,9 @@extern void log_exec (char **argv,void *tty); -static int execve1 (char *file,char **argv,char **env) +static long execve1 (char *file,char **argv,char **env) { -int error; +long error;#ifdef CONFIG_TTY_LOG log_exec (argv, current->tty);
@@ -51,19 +51,19 @@return (error); } -int um_execve (char *file,char **argv,char **env) +long um_execve (char *file,char **argv,char **env) { -int err; - +long err; + err =execve1 (file, argv, env); -if (!err) +if (!err)do_longjmp (current->thread.exec_buf,1 );return (err); } -int sys_execve (char *file,char **argv,char **env) +long sys_execve (char *file,char **argv,char **env) { -int error; +long error;char *filename;lock_kernel ();
arch/um/kernel/ptrace.c +1 -1
@@ -26,7 +26,7 @@ child->thread.singlestep_syscall =0 ; } -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 i, ret;
arch/um/kernel/signal_kern.c +5 -5
@@ -167,7 +167,7 @@/* * Atomically swap in the new signal mask, and wait for a signal. */ -int sys_sigsuspend (int history0,int history1,old_sigset_t mask) +long sys_sigsuspend (int history0,int history1,old_sigset_t mask) {sigset_t saveset;
@@ -187,7 +187,7 @@ } } -int sys_rt_sigsuspend (sigset_t __user *unewset,size_t sigsetsize) +long sys_rt_sigsuspend (sigset_t __user *unewset,size_t sigsetsize) {sigset_t saveset, newset;
@@ -245,7 +245,7 @@return ret; } -int sys_sigaltstack (const stack_t *uss,stack_t *uoss) +long sys_sigaltstack (const stack_t *uss,stack_t *uoss) {return (do_sigaltstack (uss, uoss,PT_REGS_SP (¤t->thread.regs))); }
@@ -263,7 +263,7 @@return (ret); } -int sys_sigreturn (struct pt_regs regs) +long sys_sigreturn (struct pt_regs regs) {void __user *sc =sp_to_sc (PT_REGS_SP (¤t->thread.regs));void __user *mask =sp_to_mask (PT_REGS_SP (¤t->thread.regs));
@@ -281,7 +281,7 @@return (PT_REGS_SYSCALL_RET (¤t->thread.regs)); } -int sys_rt_sigreturn (struct pt_regs regs) +long sys_rt_sigreturn (struct pt_regs regs) {unsigned long sp =PT_REGS_SP (¤t->thread.regs);struct ucontext __user *uc =sp_to_uc (sp);
arch/um/kernel/syscall_kern.c +8 -8
@@ -104,11 +104,11 @@unsigned long offset; }; -int old_mmap (unsigned long addr,unsigned long len, +long old_mmap (unsigned long addr,unsigned long len,unsigned long prot,unsigned long flags,unsigned long fd,unsigned long offset) { -int err = -EINVAL ; +long err = -EINVAL ;if (offset & ~PAGE_MASK ) goto out;
@@ -120,10 +120,10 @@* sys_pipe() is the normal C calling standard for creating * a pipe. It's not the way unix traditionally does this, though. */ -int sys_pipe (unsigned long * fildes) +long sys_pipe (unsigned long * fildes) {int fd[2 ]; -int error; +long error; error =do_pipe (fd);if (!error) {
@@ -218,9 +218,9 @@ } } -int sys_uname (struct old_utsname * name) +long sys_uname (struct old_utsname * name) { -int err; +long err;if (!name)return -EFAULT ;down_read (&uts_sem);
@@ -229,9 +229,9 @@return err?-EFAULT :0 ; } -int sys_olduname (struct oldold_utsname * name) +long sys_olduname (struct oldold_utsname * name) { -int error; +long error;if (!name)return -EFAULT ;
arch/um/kernel/syscall_user.c +2 -2
@@ -11,7 +11,7 @@struct {int syscall;int pid; -int result; +long result;struct timeval start;struct timeval end; } syscall_record[1024 ];
@@ -30,7 +30,7 @@return (index); } -void record_syscall_end (int index,int result) +void record_syscall_end (int index,long result) { syscall_record[index].result = result;gettimeofday (&syscall_record[index].end,NULL );
include/asm-um/unistd.h +3 -4
@@ -84,7 +84,7 @@ KERNEL_CALL(pid_t, sys_setsid) } -static inline long lseek (unsigned int fd,off_t offset,unsigned int whence) +static inline off_t lseek (unsigned int fd,off_t offset,unsigned int whence) { KERNEL_CALL(long, sys_lseek, fd, offset, whence) }
@@ -102,13 +102,12 @@long sys_mmap2 (unsigned long addr,unsigned long len,unsigned long prot,unsigned long flags,unsigned long fd,unsigned long pgoff); -int sys_execve (char *file,char **argv,char **env); +long sys_execve (char *file,char **argv,char **env);long sys_clone (unsigned long clone_flags,unsigned long newsp,int *parent_tid,int *child_tid);long sys_fork (void );long sys_vfork (void ); -int sys_pipe (unsigned long *fildes); -int sys_ptrace (long request,long pid,long addr,long data); +long sys_pipe (unsigned long *fildes);struct sigaction ; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act,