Adjust name of ld.so in test-container.c.
[glibc.git] / sysdeps / htl / raise.c
blobd2f21c8a3ffcb870f87ac2e65b61655ec414fcd6
1 /* raise.c - Generic raise implementation.
2 Copyright (C) 2008-2018 Free Software Foundation, Inc.
3 Written by Neal H. Walfield <neal@gnu.org>.
5 This file is part of the GNU Hurd.
7 The GNU Hurd is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public License
9 as published by the Free Software Foundation; either version 3 of
10 the License, or (at your option) any later version.
12 The GNU Hurd is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this program. If not, see
19 <http://www.gnu.org/licenses/>. */
21 #include <pthreadP.h>
22 #include <signal.h>
23 #include <unistd.h>
25 #pragma weak __pthread_kill
26 #pragma weak __pthread_self
27 #pragma weak __pthread_threads
28 int
29 raise (int signo)
31 /* According to POSIX, if we implement threads (and we do), then
32 "the effect of the raise() function shall be equivalent to
33 calling: pthread_kill(pthread_self(), sig);" */
35 if (__pthread_kill != NULL && __pthread_threads != NULL)
37 int err;
38 err = __pthread_kill (__pthread_self (), signo);
39 if (err)
41 errno = err;
42 return -1;
44 return 0;
46 else
47 return __kill (__getpid (), signo);
50 libc_hidden_def (raise)
51 weak_alias (raise, gsignal)