linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Christoph Hellwig <hch@lst.de>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org, linux@arm.linux.org.uk,
	dhowells@redhat.com, ysato@users.sourceforge.jp,
	tony.luck@intel.com, geert@linux-m68k.org, zippel@linux-m68k.org,
	gerg@uclinux.org, schwidefsky@de.ibm.com,
	heiko.carstens@de.ibm.com, jdike@addtoit.com, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com, viro@zeniv.linux.org.uk
Subject: Re: [PATCH 1/3] generic sys_old_select
Date: Wed, 6 Jan 2010 10:32:59 -0700	[thread overview]
Message-ID: <20100106173258.GJ9882@parisc-linux.org> (raw)
In-Reply-To: <20100106172112.GA17163@lst.de>

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."

  parent reply	other threads:[~2010-01-06 17:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 17:21 [PATCH 1/3] generic sys_old_select Christoph Hellwig
2010-01-06 17:21 ` Christoph Hellwig
2010-01-06 17:32 ` Matthew Wilcox [this message]
2010-01-06 17:34   ` Christoph Hellwig
2010-01-06 17:41     ` Al Viro
2010-01-06 17:47       ` H. Peter Anvin
2010-01-08  9:31       ` Christoph Hellwig
2010-01-08 22:22         ` H. Peter Anvin
2010-01-10  4:49           ` Al Viro
2010-01-06 17:44 ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2010-01-08 22:52 Andreas Mohr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100106173258.GJ9882@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=geert@linux-m68k.org \
    --cc=gerg@uclinux.org \
    --cc=hch@lst.de \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jdike@addtoit.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@redhat.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=ysato@users.sourceforge.jp \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).