Back out previous. It seems to expose another bug in libpthread/libc,

potentially errno being used before threading is up and running.
This commit is contained in:
ad 2008-03-22 14:19:27 +00:00
parent 978a8525ec
commit 783e2f6db5
2 changed files with 14 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pthread.c,v 1.98 2008/03/21 21:35:43 ad Exp $ */
/* $NetBSD: pthread.c,v 1.99 2008/03/22 14:19:27 ad Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: pthread.c,v 1.98 2008/03/21 21:35:43 ad Exp $");
__RCSID("$NetBSD: pthread.c,v 1.99 2008/03/22 14:19:27 ad Exp $");
#define __EXPOSE_STACK 1
@ -918,6 +918,16 @@ pthread__cleanup_pop(int ex, void *store)
}
int *
pthread__errno(void)
{
pthread_t self;
self = pthread__self();
return &(self->pt_errno);
}
ssize_t _sys_write(int, const void *, size_t);
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: pthread_specific.c,v 1.18 2008/03/21 21:35:43 ad Exp $ */
/* $NetBSD: pthread_specific.c,v 1.19 2008/03/22 14:19:27 ad Exp $ */
/*-
* Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: pthread_specific.c,v 1.18 2008/03/21 21:35:43 ad Exp $");
__RCSID("$NetBSD: pthread_specific.c,v 1.19 2008/03/22 14:19:27 ad Exp $");
/* Functions and structures dealing with thread-specific data */
@ -87,10 +87,3 @@ pthread_curcpu_np(void)
return cpu;
}
int *
pthread__errno(void)
{
return &(pthread__self()->pt_errno);
}