1*8caf1030Smatt /* $NetBSD: thread-stub-init.c,v 1.2 2013/08/19 22:14:37 matt Exp $ */
2644dcf79Schristos
3644dcf79Schristos /*-
4644dcf79Schristos * Copyright (c) 2003, 2009 The NetBSD Foundation, Inc.
5644dcf79Schristos * All rights reserved.
6644dcf79Schristos *
7644dcf79Schristos * This code is derived from software contributed to The NetBSD Foundation
8644dcf79Schristos * by Jason R. Thorpe.
9644dcf79Schristos *
10644dcf79Schristos * Redistribution and use in source and binary forms, with or without
11644dcf79Schristos * modification, are permitted provided that the following conditions
12644dcf79Schristos * are met:
13644dcf79Schristos * 1. Redistributions of source code must retain the above copyright
14644dcf79Schristos * notice, this list of conditions and the following disclaimer.
15644dcf79Schristos * 2. Redistributions in binary form must reproduce the above copyright
16644dcf79Schristos * notice, this list of conditions and the following disclaimer in the
17644dcf79Schristos * documentation and/or other materials provided with the distribution.
18644dcf79Schristos *
19644dcf79Schristos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20644dcf79Schristos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21644dcf79Schristos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22644dcf79Schristos * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23644dcf79Schristos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24644dcf79Schristos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25644dcf79Schristos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26644dcf79Schristos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27644dcf79Schristos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28644dcf79Schristos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29644dcf79Schristos * POSSIBILITY OF SUCH DAMAGE.
30644dcf79Schristos */
31644dcf79Schristos
32644dcf79Schristos #include <sys/cdefs.h>
33644dcf79Schristos #if defined(LIBC_SCCS) && !defined(lint)
34*8caf1030Smatt __RCSID("$NetBSD: thread-stub-init.c,v 1.2 2013/08/19 22:14:37 matt Exp $");
35644dcf79Schristos #endif /* LIBC_SCCS and not lint */
36644dcf79Schristos
37644dcf79Schristos #ifdef _REENTRANT
38644dcf79Schristos #define __LIBC_THREAD_STUBS
39644dcf79Schristos #include "reentrant.h"
40644dcf79Schristos #include <signal.h>
41644dcf79Schristos
42644dcf79Schristos /* libpthread init */
43644dcf79Schristos
__weak_alias(__libc_thr_init,__libc_thr_init_stub)44644dcf79Schristos __weak_alias(__libc_thr_init,__libc_thr_init_stub)
45644dcf79Schristos
46*8caf1030Smatt void __section(".text.startup")
47644dcf79Schristos __libc_thr_init_stub(void)
48644dcf79Schristos {
49644dcf79Schristos
50644dcf79Schristos /* nothing, may be overridden by libpthread */
51644dcf79Schristos }
52644dcf79Schristos
53644dcf79Schristos #define DIE() (void)raise(SIGABRT)
54644dcf79Schristos
__weak_alias(__libc_thr_errno,__libc_thr_errno_stub)55644dcf79Schristos __weak_alias(__libc_thr_errno,__libc_thr_errno_stub)
56644dcf79Schristos int *
57644dcf79Schristos __libc_thr_errno_stub(void)
58644dcf79Schristos {
59644dcf79Schristos DIE();
60644dcf79Schristos
61644dcf79Schristos return (NULL);
62644dcf79Schristos }
63644dcf79Schristos #endif /* _REENTRANT */
64