lkml.org 
[lkml]   [2007]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 5/13] signal/timer/event fds v6 - signalfd compat code ...
On Sat, 17 Mar 2007, Arnd Bergmann wrote:

> On Friday 16 March 2007 01:22:15 Davide Libenzi wrote:
> > +asmlinkage long compat_sys_signalfd(int ufd,
> > +                                   const compat_sigset_t __user *sigmask,
> > +                                   compat_size_t sigsetsize)
> > +{
> > +       compat_sigset_t ss32;
> > +       sigset_t tmp;
> > +       sigset_t __user *ksigmask;
> > +
> > +       if (sigsetsize != sizeof(compat_sigset_t))
> > +               return -EINVAL;
> > +       if (copy_from_user(&ss32, sigmask, sizeof(ss32)))
> > +               return -EFAULT;
> > +       sigset_from_compat(&tmp, &ss32);
> > +       ksigmask = compat_alloc_user_space(sizeof(sigset_t));
> > +       if (copy_to_user(ksigmask, &tmp, sizeof(sigset_t)))
> > +               return -EFAULT;
> > +
> > +       return sys_signalfd(ufd, ksigmask, sizeof(sigset_t));
> > +}
>
> Doing the compat_alloc_user_space() magic obviously makes the 32 bit
> emulation code less efficient. How about having a
>
> long do_signalfd(int ufd, const sigset_t *sigmask, size_t sigsetsize);
>
> that is called directly by both sys_signalfd and compat_sys_signalfd?
> Same obviously applies also to do_timerfd.

Hmm, copy_*_user (one or two moves) and compat_alloc_user_space are
pretty fast...



- Davide

\
 
 \ /
  Last update: 2007-03-18 21:47    [W:0.039 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site