xref: /llvm-project/libc/src/signal/linux/sigfillset.cpp (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
166d00febSPaula Toth //===-- Linux implementation of sigfillset --------------------------------===//
2123a5328SAlex Brachet //
3123a5328SAlex Brachet // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4123a5328SAlex Brachet // See https://llvm.org/LICENSE.txt for license information.
5123a5328SAlex Brachet // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6123a5328SAlex Brachet //
7123a5328SAlex Brachet //===----------------------------------------------------------------------===//
8123a5328SAlex Brachet 
9123a5328SAlex Brachet #include "src/signal/sigfillset.h"
10f626a350SNick Desaulniers 
11f626a350SNick Desaulniers #include "hdr/types/sigset_t.h"
12123a5328SAlex Brachet #include "src/__support/common.h"
13*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
147abf6c25SSiva Chandra Reddy #include "src/errno/libc_errno.h"
15215c9fa4SSiva Chandra Reddy #include "src/signal/linux/signal_utils.h"
16215c9fa4SSiva Chandra Reddy 
17*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
18123a5328SAlex Brachet 
19a0b65a7bSMichael Jones LLVM_LIBC_FUNCTION(int, sigfillset, (sigset_t * set)) {
20123a5328SAlex Brachet   if (!set) {
217abf6c25SSiva Chandra Reddy     libc_errno = EINVAL;
22123a5328SAlex Brachet     return -1;
23123a5328SAlex Brachet   }
24215c9fa4SSiva Chandra Reddy   *set = full_set();
25123a5328SAlex Brachet   return 0;
26123a5328SAlex Brachet }
27123a5328SAlex Brachet 
28*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
29