On Wed, Jan 06, 2010 at 06:21:12PM +0100, Christoph Hellwig wrote: > Add a generic implementation of the old select syscall, which expects it's > argument in a memory block and switch all architectures over to use it. Don't we want an ifdef around compat_sys_old_select() like the one around sys_old_select()? > Index: linux-2.6/fs/select.c > =================================================================== > --- linux-2.6.orig/fs/select.c 2009-12-17 09:39:54.792277244 +0100 > +++ linux-2.6/fs/select.c 2009-12-26 13:39:31.501255812 +0100 > @@ -691,6 +691,23 @@ SYSCALL_DEFINE6(pselect6, int, n, fd_set > } > #endif /* HAVE_SET_RESTORE_SIGMASK */ > > +#ifdef __ARCH_WANT_SYS_OLD_SELECT > +struct sel_arg_struct { > + unsigned long n; > + fd_set __user *inp, *outp, *exp; > + struct timeval __user *tvp; > +}; > + > +SYSCALL_DEFINE1(old_select, struct sel_arg_struct __user *, arg) > +{ > + struct sel_arg_struct a; > + > + if (copy_from_user(&a, arg, sizeof(a))) > + return -EFAULT; > + return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); > +} > +#endif > + > struct poll_list { > struct poll_list *next; > int len; > Index: linux-2.6/fs/compat.c > =================================================================== > --- linux-2.6.orig/fs/compat.c 2009-12-26 13:43:52.431003939 +0100 > +++ linux-2.6/fs/compat.c 2009-12-26 13:49:24.179256485 +0100 > @@ -1795,6 +1795,24 @@ asmlinkage long compat_sys_select(int n, > return ret; > } > > +struct compat_sel_arg_struct { > + compat_ulong_t n; > + compat_ulong_t inp; > + compat_ulong_t outp; > + compat_ulong_t exp; > + compat_ulong_t tvp; > +}; > + > +asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg) > +{ > + struct compat_sel_arg_struct a; > + > + if (copy_from_user(&a, arg, sizeof(a))) > + return -EFAULT; > + return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp), > + compat_ptr(a.exp), compat_ptr(a.tvp)); > +} > + > #ifdef HAVE_SET_RESTORE_SIGMASK > static long do_compat_pselect(int n, compat_ulong_t __user *inp, > compat_ulong_t __user *outp, compat_ulong_t __user *exp, -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html