aboutsummaryrefslogtreecommitdiff
path: root/libc/src/sched/linux/sched_setcpuzero.cpp
blob: 28c789a7f25b1701ccf4354feb7b6ff151691535 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//===-- Implementation of sched_setcpuzero --------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "src/sched/sched_setcpuzero.h"

#include "src/__support/common.h"            // LLVM_LIBC_FUNCTION
#include "src/__support/macros/config.h"     // LIBC_NAMESPACE_DECL
#include "src/__support/macros/null_check.h" // LIBC_CRASH_ON_NULLPTR

#include "hdr/types/cpu_set_t.h"
#include "hdr/types/size_t.h"

namespace LIBC_NAMESPACE_DECL {

LLVM_LIBC_FUNCTION(void, __sched_setcpuzero,
                   (const size_t cpuset_size, cpu_set_t *set)) {
  LIBC_CRASH_ON_NULLPTR(set);
  __builtin_memset(set, 0, cpuset_size);
}

} // namespace LIBC_NAMESPACE_DECL