Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/thread-stub split init and errno to a separate file...
details: https://anonhg.NetBSD.org/src/rev/f09f53d1b20d
branches: trunk
changeset: 785903:f09f53d1b20d
user: christos <christos%NetBSD.org@localhost>
date: Fri Apr 05 20:15:42 2013 +0000
description:
split init and errno to a separate file. No point in growing rtld 10K.
diffstat:
lib/libc/thread-stub/Makefile.inc | 4 +-
lib/libc/thread-stub/thread-stub-init.c | 63 +++++++++++++++++++++++++++++++++
lib/libc/thread-stub/thread-stub.c | 25 +------------
3 files changed, 67 insertions(+), 25 deletions(-)
diffs (141 lines):
diff -r b8b4af8d5753 -r f09f53d1b20d lib/libc/thread-stub/Makefile.inc
--- a/lib/libc/thread-stub/Makefile.inc Fri Apr 05 19:15:08 2013 +0000
+++ b/lib/libc/thread-stub/Makefile.inc Fri Apr 05 20:15:42 2013 +0000
@@ -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
diff -r b8b4af8d5753 -r f09f53d1b20d lib/libc/thread-stub/thread-stub-init.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/thread-stub/thread-stub-init.c Fri Apr 05 20:15:42 2013 +0000
@@ -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 */
diff -r b8b4af8d5753 -r f09f53d1b20d lib/libc/thread-stub/thread-stub.c
--- a/lib/libc/thread-stub/thread-stub.c Fri Apr 05 19:15:08 2013 +0000
+++ b/lib/libc/thread-stub/thread-stub.c Fri Apr 05 20:15:42 2013 +0000
@@ -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 @@
#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_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 @@
return (t1 == t2);
}
-int *
-__libc_thr_errno_stub(void)
-{
-
- DIE();
-
- return (NULL);
-}
-
unsigned int
__libc_thr_curcpu_stub(void)
{
Home |
Main Index |
Thread Index |
Old Index