1 //===-- Linux implementation of signal ------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "src/signal/raise.h"
10 #include "src/signal/linux/signal_utils.h"
12 #include "src/__support/common.h"
14 namespace __llvm_libc
{
16 LLVM_LIBC_FUNCTION(int, raise
, (int sig
)) {
18 block_all_signals(sigset
);
19 long pid
= __llvm_libc::syscall_impl(SYS_getpid
);
20 long tid
= __llvm_libc::syscall_impl(SYS_gettid
);
21 int ret
= __llvm_libc::syscall_impl(SYS_tgkill
, pid
, tid
, sig
);
22 restore_signals(sigset
);
26 } // namespace __llvm_libc