• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 //===----------------------------------------------------------------------===//
8 
9 #include "src/signal/sigprocmask.h"
10 #include "src/errno/llvmlibc_errno.h"
11 #include "src/signal/linux/signal.h"
12 
13 #include "src/__support/common.h"
14 
15 namespace __llvm_libc {
16 
LLVM_LIBC_ENTRYPOINT(sigprocmask)17 int LLVM_LIBC_ENTRYPOINT(sigprocmask)(int how, const sigset_t *__restrict set,
18                                       sigset_t *__restrict oldset) {
19   int ret = __llvm_libc::syscall(SYS_rt_sigprocmask, how, set, oldset,
20                                  sizeof(sigset_t));
21   if (!ret)
22     return 0;
23 
24   llvmlibc_errno = -ret;
25   return -1;
26 }
27 
28 } // namespace __llvm_libc
29