From ac31bf278d9ed855e6765bb71d64ed19d2b7c0f8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 10 Jun 2014 04:49:49 -0400 Subject: simplify errno implementation the motivation for the errno_ptr field in the thread structure, which this commit removes, was to allow the main thread's errno to keep its address when lazy thread pointer initialization was used. &errno was evaluated prior to setting up the thread pointer and stored in errno_ptr for the main thread; subsequently created threads would have errno_ptr pointing to their own errno_val in the thread structure. since lazy initialization was removed, there is no need for this extra level of indirection; __errno_location can simply return the address of the thread's errno_val directly. this does cause &errno to change, but the change happens before entry to application code, and thus is not observable. --- src/thread/pthread_create.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/thread') diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index 7a2f172c..e9c8160a 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -201,7 +201,6 @@ int pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict attrp new->stack = stack; new->stack_size = stack - stack_limit; new->pid = self->pid; - new->errno_ptr = &new->errno_val; new->start = entry; new->start_arg = arg; new->self = new; -- cgit v1.2.1