lkml.org 
[lkml]   [2003]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] revert zap_other_threads breakage, disallow CLONE_THREAD without CLONE_DETACHED

On Tue, 12 Aug 2003, Roland McGrath wrote:
>
> Please apply this patch to get us back out of this useless quagmire and
> disallow the problematic case that noone wants to try to use any more.
>
> - if ((clone_flags & CLONE_THREAD) && !(clone_flags & CLONE_SIGHAND))
> + if ((clone_flags & CLONE_THREAD) &&
> + (clone_flags & (CLONE_SIGHAND|CLONE_DETACHED)) != (CLONE_SIGHAND|CLONE_DETACHED))
> return ERR_PTR(-EINVAL);
> if ((clone_flags & CLONE_DETACHED) && !(clone_flags & CLONE_THREAD))

Look at the condition that follows: it disallows CLONE_DETACHED for
non-threads.

Which really means that together with the first change, CLONE_DETACHED is
always the same thing as CLONE_THREAD: you can't have one without the
other.

Which means that they are logically not separate bits any more, and we
should just get rid of CLONE_DETACHED altogether, and use CLONE_THREAD in
all cases where it is tested for.

I'd really prefer not to keep a bit around that has to mean the same thing
as another bit - that way just lies madness. So I'll document
CLONE_DETACHED as being a no-op, and change the _one_ place that used it
to just use CLONE_THREAD instead.

Linus

-
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: 2009-11-18 23:46    [W:0.079 / U:0.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site