Module Name: src
Committed By: christos
Date: Fri Apr 5 20:15:42 UTC 2013
Modified Files:
src/lib/libc/thread-stub: Makefile.inc thread-stub.c
Added Files:
src/lib/libc/thread-stub: thread-stub-init.c
Log Message:
split init and errno to a separate file. No point in growing rtld 10K.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/thread-stub/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/thread-stub/thread-stub-init.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/thread-stub/thread-stub.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/thread-stub/Makefile.inc
diff -u src/lib/libc/thread-stub/Makefile.inc:1.3 src/lib/libc/thread-stub/Makefile.inc:1.4
--- src/lib/libc/thread-stub/Makefile.inc:1.3 Sat Jan 18 06:33:18 2003
+++ src/lib/libc/thread-stub/Makefile.inc Fri Apr 5 16:15:42 2013
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile.inc,v 1.3 2003/01/18 11:33:18 thorpej Exp $
+# $NetBSD: Makefile.inc,v 1.4 2013/04/05 20:15:42 christos Exp $
.include <bsd.own.mk>
# Our sources
.PATH: ${.CURDIR}/thread-stub
-SRCS+= __isthreaded.c thread-stub.c
+SRCS+= __isthreaded.c thread-stub.c thread-stub-init.c
Index: src/lib/libc/thread-stub/thread-stub.c
diff -u src/lib/libc/thread-stub/thread-stub.c:1.23 src/lib/libc/thread-stub/thread-stub.c:1.24
--- src/lib/libc/thread-stub/thread-stub.c:1.23 Thu Mar 21 12:49:11 2013
+++ src/lib/libc/thread-stub/thread-stub.c Fri Apr 5 16:15:42 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: thread-stub.c,v 1.23 2013/03/21 16:49:11 christos Exp $ */
+/* $NetBSD: thread-stub.c,v 1.24 2013/04/05 20:15:42 christos Exp $ */
/*-
* Copyright (c) 2003, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: thread-stub.c,v 1.23 2013/03/21 16:49:11 christos Exp $");
+__RCSID("$NetBSD: thread-stub.c,v 1.24 2013/04/05 20:15:42 christos Exp $");
#endif /* LIBC_SCCS and not lint */
/*
@@ -67,17 +67,6 @@ do { \
#define CHECK_NOT_THREADED() /* nothing */
#endif
-/* libpthread init */
-
-__weak_alias(__libc_thr_init,__libc_thr_init_stub)
-
-void
-__libc_thr_init_stub(void)
-{
-
- /* nothing, may be overridden by libpthread */
-}
-
/* mutexes */
int __libc_mutex_catchall_stub(mutex_t *);
@@ -349,7 +338,6 @@ __weak_alias(__libc_thr_self,__libc_thr_
__weak_alias(__libc_thr_yield,__libc_thr_yield_stub)
__weak_alias(__libc_thr_create,__libc_thr_create_stub)
__weak_alias(__libc_thr_exit,__libc_thr_exit_stub)
-__weak_alias(__libc_thr_errno,__libc_thr_errno_stub)
__weak_alias(__libc_thr_setcancelstate,__libc_thr_setcancelstate_stub)
__weak_alias(__libc_thr_equal,__libc_thr_equal_stub)
__weak_alias(__libc_thr_curcpu,__libc_thr_curcpu_stub)
@@ -441,15 +429,6 @@ __libc_thr_equal_stub(pthread_t t1, pthr
return (t1 == t2);
}
-int *
-__libc_thr_errno_stub(void)
-{
-
- DIE();
-
- return (NULL);
-}
-
unsigned int
__libc_thr_curcpu_stub(void)
{
Added files:
Index: src/lib/libc/thread-stub/thread-stub-init.c
diff -u /dev/null src/lib/libc/thread-stub/thread-stub-init.c:1.1
--- /dev/null Fri Apr 5 16:15:42 2013
+++ src/lib/libc/thread-stub/thread-stub-init.c Fri Apr 5 16:15:42 2013
@@ -0,0 +1,63 @@
+/* $NetBSD: thread-stub-init.c,v 1.1 2013/04/05 20:15:42 christos Exp $ */
+
+/*-
+ * Copyright (c) 2003, 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: thread-stub-init.c,v 1.1 2013/04/05 20:15:42 christos Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef _REENTRANT
+#define __LIBC_THREAD_STUBS
+#include "reentrant.h"
+#include <signal.h>
+
+/* libpthread init */
+
+__weak_alias(__libc_thr_init,__libc_thr_init_stub)
+
+void
+__libc_thr_init_stub(void)
+{
+
+ /* nothing, may be overridden by libpthread */
+}
+
+#define DIE() (void)raise(SIGABRT)
+
+__weak_alias(__libc_thr_errno,__libc_thr_errno_stub)
+int *
+__libc_thr_errno_stub(void)
+{
+ DIE();
+
+ return (NULL);
+}
+#endif /* _REENTRANT */