This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Thread-, Signal- and Cancellation-safety documentation
- From: Rich Felker <dalias at aerifal dot cx>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Alexandre Oliva <aoliva at redhat dot com>, Torvald Riegel <triegel at redhat dot com>, KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 4 Jun 2013 10:39:47 -0400
- Subject: Re: Thread-, Signal- and Cancellation-safety documentation
- References: <ora9ncqlg4 dot fsf at livre dot home> <51A86363 dot 2000900 at redhat dot com> <orip1yq3ek dot fsf at livre dot home> <20130601025934 dot GJ20323 at brightrain dot aerifal dot cx> <or61xxi33w dot fsf at livre dot home> <20130602142028 dot GL20323 at brightrain dot aerifal dot cx> <orli6sh1ju dot fsf at livre dot home> <51ADE0D3 dot 3050102 at redhat dot com> <20130604141945 dot GI29800 at brightrain dot aerifal dot cx> <51ADF943 dot 5010909 at redhat dot com>
On Tue, Jun 04, 2013 at 04:27:15PM +0200, Florian Weimer wrote:
> On 06/04/2013 04:19 PM, Rich Felker wrote:
>
> >The clone syscall is not needed; the unshare syscall will do. I don't
> >know whether it's part of glibc's interface contract for this to work,
> >but as far as I can tell, pthread_create and calling unshare in the
> >new thread is safe and usable with most if not all of the current
> >unshare flags.
>
> The unshare manual page talks about the process, not about the
> calling process. Does it really apply to the thread only? Then we
> should fix the manual page.
Yes. It's one of a large number of Linux man pages that have this bug.
Fixing them all is a big project, but would be a valuable
contribution, since the misunderstandings stemming from them are a
huge source of confusion programmers new to Linux face...
Rich