[clang] Propagate -ftime-report to offload lto (#122143)
[llvm-project.git] / libc / src / signal / linux / sigprocmask.cpp
blob8838379ae5d304db811e7afb51a14662255a1226
1 //===-- Linux implementation of sigprocmask -------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 #include "src/signal/sigprocmask.h"
11 #include "hdr/types/sigset_t.h"
12 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
13 #include "src/__support/common.h"
14 #include "src/__support/macros/config.h"
15 #include "src/errno/libc_errno.h"
16 #include "src/signal/linux/signal_utils.h"
18 #include <sys/syscall.h> // For syscall numbers.
20 namespace LIBC_NAMESPACE_DECL {
22 LLVM_LIBC_FUNCTION(int, sigprocmask,
23 (int how, const sigset_t *__restrict set,
24 sigset_t *__restrict oldset)) {
25 int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_rt_sigprocmask, how, set,
26 oldset, sizeof(sigset_t));
27 if (!ret)
28 return 0;
30 libc_errno = -ret;
31 return -1;
34 } // namespace LIBC_NAMESPACE_DECL