1 | //===-- Implementation of sched_setcpuzero --------------------------------===// |
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/sched/sched_setcpuzero.h" |
10 | |
11 | #include "src/__support/common.h" // LLVM_LIBC_FUNCTION |
12 | #include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL |
13 | #include "src/__support/macros/null_check.h" // LIBC_CRASH_ON_NULLPTR |
14 | |
15 | #include "hdr/types/cpu_set_t.h" |
16 | #include "hdr/types/size_t.h" |
17 | |
18 | namespace LIBC_NAMESPACE_DECL { |
19 | |
20 | LLVM_LIBC_FUNCTION(void, __sched_setcpuzero, |
21 | (const size_t cpuset_size, cpu_set_t *set)) { |
22 | LIBC_CRASH_ON_NULLPTR(set); |
23 | __builtin_memset(set, 0, cpuset_size); |
24 | } |
25 | |
26 | } // namespace LIBC_NAMESPACE_DECL |
27 | |