lkml.org 
[lkml]   [2006]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm 3/5][AIO] - export good_sigevent()
On Mon, 4 Dec 2006 22:43:13 +0530 Bharata B Rao <bharata@in.ibm.com> wrote:

> On Wed, Nov 29, 2006 at 11:32:34AM +0100, Sébastien Dugué wrote:
> >
> > <snip>
> > +/***
> > + * good_sigevent - check and get target task from a sigevent.
> > + * @event: the sigevent to be checked
> > + *
> > + * This function must be called with tasklist_lock held for reading.
> > + */
> > +struct task_struct * good_sigevent(sigevent_t * event)
> > +{
> > + struct task_struct *rtn = current->group_leader;
> > +
> > + if ((event->sigev_notify & SIGEV_THREAD_ID ) &&
> > + (!(rtn = find_task_by_pid(event->sigev_notify_thread_id)) ||
> > + rtn->tgid != current->tgid ||
> > + (event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL))
> > + return NULL;
> > +
> > + if (((event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) &&
> > + ((event->sigev_signo <= 0) || (event->sigev_signo > SIGRTMAX)))
> > + return NULL;
> > +
> > + return rtn;
> > +}
>
> Here good_sigevent() doesn't take care of SIGEV_THREAD. From this comment
> from include/asm-generic/siginfo.h,
>
> "It seems likely that SIGEV_THREAD will have to be handled from
> userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
> thread manager then catches and does the appropriate nonsense.
> However, everything is written out here so as to not get lost."
>
> it looks like SIGEV_THREAD should never come into kernel. But atleast
> libposix-aio does send SIGEV_THREAD all the way up to kernel.

That's right, I had to reflect that change into libposix-aio, i.e. transmuting
SIGEV_THREAD into SIGEV_SIGNAL.

Sébastien.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-12-05 09:33    [W:0.048 / U:4.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site