DragonFly BSD
DragonFly kernel List (threaded) for 2005-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: patch #1 to add pointer to errno in TCB (Re: The time has come for a kernel interfacing library layer)

From: David Xu <davidxu@xxxxxxxxxxx>
Date: Tue, 10 May 2005 12:51:52 +0800

4890@xxxxxxxxxxxxxxxxx> <200505100139.j4A1dnsW020010@xxxxxxxxxxxxxxxxxxxx>
In-Reply-To: <200505100139.j4A1dnsW020010@xxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 31
Message-ID: <42803da2$0$718$415eb37d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
X-Trace: 1115700643 crater_reader.dragonflybsd.org 718
Xref: crater_reader.dragonflybsd.org dragonfly.kernel:8395

Matthew Dillon wrote:
>     Ok.  Here's the first patch. 
>     * Call to _init_tls() from the CRT startup code is now mandatory for
>       both static and dynamic binaries.
>     * Pointer to errno now embedded in the TCB.  The errno is still a
>       __thread (or whatever)... that hasn't changed.
>     * TLS allocation code is now passed additional parameters so it can
>       properly set the errno pointer.
>     * cerror() now sets the errno by indirecting through the errno pointer
>       in the TCB.
>     * I did a quick test for a standard link, static link, pthreads link,
>       and -lthread_xu link to make sure the errno pointer matches &errno.
>     This will also allow the syscall layer code to set errno without having
>     to be dynamically linked or relocated.
>     Please test!
> 						-Matt
I am confused that rtld-elf does not need threaded errno whether you
implement it as old libc( use a function ) or not,  rtld-elf
definitively will run under threaded process, its code will be
executed by multiple threads at same time!

David Xu

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]