Skip to content
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1a2fe13
feat: add proxy header for `cpu_set_t`
krishna2803 Feb 7, 2025
ba8c535
fix: replace <sched.h> with proxy headers
krishna2803 Feb 7, 2025
c6a14a1
fix: rename `__mask` to `__bits` for compatibility with glibc cpu_set_t
krishna2803 Feb 11, 2025
822bdb0
fix: change to proxy headers for `cpu_set_t`, `size_t` and `pid_t` types
krishna2803 Feb 11, 2025
00b5943
fix: update CMakeLists for proxy header dependencies
krishna2803 Feb 11, 2025
8c990d2
style: clang-format
krishna2803 Feb 11, 2025
926702c
fix: add proxy headers for unittests
krishna2803 Feb 11, 2025
02b5e6c
fix: add proxy header for `struct_sched_param`
krishna2803 Feb 11, 2025
99ee89d
fix: add proxy header for `sched_macros`
krishna2803 Feb 11, 2025
5a91cde
fix: tests for sched functions
krishna2803 Feb 11, 2025
ece948f
style: clang-format
krishna2803 Feb 11, 2025
c2ccccf
fix: remove unused dependencies from CMakeLists
krishna2803 Feb 12, 2025
fd0ec52
fix: remove unused header and comply llvm coding standard
krishna2803 Feb 12, 2025
32f9a0a
fix: add missing header for struct_timespec
krishna2803 Feb 12, 2025
88fd93f
Merge branch 'main' into fix-cpuset-includes
krishna2803 Feb 13, 2025
b34baef
fix: add `libc.include.llvm-libc-macros.sched_macros` for full build …
krishna2803 Feb 14, 2025
de1eead
fix: attempt fix for `struct_timespec`
krishna2803 Feb 15, 2025
55849ca
fix: attempt fix for `sched`
krishna2803 Feb 15, 2025
7b48a0c
add: sched.h in scudo CMakeListsts
krishna2803 Feb 16, 2025
9a42b90
revert: "add: sched.h in scudo CMakeListsts"
krishna2803 Feb 16, 2025
8baed07
merge: branch 'main' into fix-cpuset-includes
krishna2803 Feb 23, 2025
9228a3b
revert: "fix: attempt fix for `struct_timespec`"
krishna2803 Feb 23, 2025
0811fb1
revert: "fix: attempt fix for `sched`"
krishna2803 Feb 23, 2025
23f30e9
merge: branch 'main' into fix-cpuset-includes
krishna2803 Feb 27, 2025
cbcaf85
merge: branch 'main' into fix-cpuset-includes
krishna2803 Mar 5, 2025
3f67c42
fix: attempt removing sched.h
krishna2803 Mar 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libc/hdr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,13 @@ add_proxy_header_library(
libc.include.wchar
)

add_proxy_header_library(
sched_macros
HDRS
sched_macros.h
FULL_BUILD_DEPENDS
libc.include.llvm-libc-macros.sched_macros
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you test adding a line here:

Suggested change
libc.include.llvm-libc-macros.sched_macros
libc.include.sched

It's ultimately not correct, but @michaelrj-google and I have a hypothesis that anchoring a dependency in libc/config/{OS}/{ARCH}/entrypoints.txt has a race for fullbuild when using scudo.

Please just add a commit on top with that one line change; if it doesn't pass presubmit, we can drop it+force push.

If it does, we can merge this PR and file a bug/todo about looking into that race.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and.. it's still failing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the following errors when trying this PR locally:

$ cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Release  -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt" -DLLVM_LIBC_FULL_BUILD=ON -DLLVM_LIBC_INCLUDE_SCUDO=ON -DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON -DCOMPILER_RT_BUILD_GWP_ASAN=OFF -DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF -G Ninja -S ../runtimes
...
$ ninja libc
[826/826] Linking CXX static library libc/lib/libc.a
$ ninja check-libc
[5499/9162] Building CXX object libc/tes..._test.__build__.dir/cpu_count_test.cpp.o
FAILED: libc/test/src/sched/CMakeFiles/libc.test.src.sched.cpu_count_test.__build__.dir/cpu_count_test.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/usr/local/google/home/lntue/experiment/llvm-project/libc -isystem /usr/local/google/home/lntue/experiment/llvm-project/build/libc/include -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -MD -MT libc/test/src/sched/CMakeFiles/libc.test.src.sched.cpu_count_test.__build__.dir/cpu_count_test.cpp.o -MF libc/test/src/sched/CMakeFiles/libc.test.src.sched.cpu_count_test.__build__.dir/cpu_count_test.cpp.o.d -o libc/test/src/sched/CMakeFiles/libc.test.src.sched.cpu_count_test.__build__.dir/cpu_count_test.cpp.o -c /usr/local/google/home/lntue/experiment/llvm-project/libc/test/src/sched/cpu_count_test.cpp
/usr/local/google/home/lntue/experiment/llvm-project/libc/test/src/sched/cpu_count_test.cpp:32:18: error: use of undeclared identifier '__sched_getcpucount'; did you mean '__llvm_libc_21_0_0_git::__sched_getcpucount'?
  int num_cpus = CPU_COUNT(&mask);
                 ^
/usr/local/google/home/lntue/experiment/llvm-project/libc/include/llvm-libc-macros/linux/sched-macros.h:27:24: note: expanded from macro 'CPU_COUNT'
#define CPU_COUNT(set) CPU_COUNT_S(sizeof(cpu_set_t), set)
                       ^
/usr/local/google/home/lntue/experiment/llvm-project/libc/include/llvm-libc-macros/linux/sched-macros.h:26:35: note: expanded from macro 'CPU_COUNT_S'
#define CPU_COUNT_S(setsize, set) __sched_getcpucount(setsize, set)
                                  ^
/usr/local/google/home/lntue/experiment/llvm-project/libc/src/sched/sched_getcpucount.h:20:5: note: '__llvm_libc_21_0_0_git::__sched_getcpucount' declared here
int __sched_getcpucount(size_t cpuset_size, const cpu_set_t *mask);
    ^
1 error generated.
[5628/9162] Building CXX object libc/tes...st.__unit__.__build__.dir/op_tests.cpp.o
ninja: build stopped: subcommand failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, so changing from LIBC_NAMESPACE::CPU_COUNT to just CPU_COUNT is causing problems in full build mode.. i'll just keep it as it was

)

add_subdirectory(types)
add_subdirectory(func)
22 changes: 22 additions & 0 deletions libc/hdr/sched_macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//===-- Definition of macros from sched.h ---------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_HDR_SCHED_MACROS_H
#define LLVM_LIBC_HDR_SCHED_MACROS_H

#ifdef LIBC_FULL_BUILD

#include "include/llvm-libc-macros/sched-macros.h"

#else // Overlay mode

#include <sched.h>

#endif // LLVM_LIBC_FULL_BUILD

#endif // LLVM_LIBC_HDR_SCHED_MACROS_H
16 changes: 16 additions & 0 deletions libc/hdr/types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ add_proxy_header_library(
libc.include.stdio
)

add_proxy_header_library(
cpu_set_t
HDRS
cpu_set_t.h
FULL_BUILD_DEPENDS
libc.include.llvm-libc-types.cpu_set_t
)

add_proxy_header_library(
locale_t
HDRS
Expand Down Expand Up @@ -358,3 +366,11 @@ add_proxy_header_library(
FULL_BUILD_DEPENDS
libc.include.llvm-libc-types.struct_pollfd
)

add_proxy_header_library(
struct_sched_param
HDRS
struct_sched_param.h
FULL_BUILD_DEPENDS
libc.include.llvm-libc-types.struct_sched_param
)
22 changes: 22 additions & 0 deletions libc/hdr/types/cpu_set_t.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//===-- Proxy for cpu_set_t -----------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_HDR_TYPES_CPU_SET_T_H
#define LLVM_LIBC_HDR_TYPES_CPU_SET_T_H

#ifdef LIBC_FULL_BUILD

#include "include/llvm-libc-types/cpu_set_t.h"

#else // Overlay mode

#include <sched.h>

#endif // LLVM_LIBC_FULL_BUILD

#endif // LLVM_LIBC_HDR_TYPES_CPU_SET_T_H
22 changes: 22 additions & 0 deletions libc/hdr/types/struct_sched_param.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//===-- Proxy for struct sched_param --------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_HDR_TYPES_STRUCT_SCHED_PARAM_H
#define LLVM_LIBC_HDR_TYPES_STRUCT_SCHED_PARAM_H

#ifdef LIBC_FULL_BUILD

#include "include/llvm-libc-types/struct_sched_param.h"

#else // Overlay mode

#include <sched.h>

#endif // LLVM_LIBC_FULL_BUILD

#endif // LLVM_LIBC_HDR_TYPES_STRUCT_SCHED_PARAM_H
2 changes: 1 addition & 1 deletion libc/include/llvm-libc-types/cpu_set_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
typedef struct {
// If a processor with more than 1024 CPUs is to be supported in future,
// we need to adjust the size of this array.
unsigned long __mask[128 / sizeof(unsigned long)];
unsigned long __bits[128 / sizeof(unsigned long)];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the glibc implementation of cpu_set_t uses __bits instead of __mask and when we're in overlay mode, this would include sched.h from the system's libc and that might cause bugs if glibc is being used in the system

ref: https://elixir.bootlin.com/glibc/glibc-2.41/source/posix/bits/cpu-set.h#L38-L43

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we're in overlay mode, this would include sched.h from the system's libc

Right, and libc/include/llvm-libc-types/cpu_set_t.h should only be included in fullbuild mode, not overlay mode.

} cpu_set_t;

#endif // LLVM_LIBC_TYPES_CPU_SET_T_H
17 changes: 17 additions & 0 deletions libc/src/sched/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ add_entrypoint_object(
../sched_getaffinity.h
DEPENDS
libc.include.sched
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sched

libc.hdr.types.cpu_set_t
libc.hdr.types.pid_t
libc.hdr.types.size_t
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
)
Expand All @@ -18,6 +21,9 @@ add_entrypoint_object(
../sched_setaffinity.h
DEPENDS
libc.include.sched
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sched

libc.hdr.types.cpu_set_t
libc.hdr.types.pid_t
libc.hdr.types.size_t
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
)
Expand All @@ -29,6 +35,8 @@ add_entrypoint_object(
HDRS
../sched_getcpucount.h
DEPENDS
libc.hdr.types.cpu_set_t
libc.hdr.types.size_t
libc.include.sched
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sched

)

Expand All @@ -54,6 +62,8 @@ add_entrypoint_object(
libc.include.sys_syscall
libc.include.time
libc.include.sched
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sched

(all of these include are wrong)

libc.hdr.types.pid_t
libc.hdr.types.struct_sched_param
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
)
Expand All @@ -68,6 +78,8 @@ add_entrypoint_object(
libc.include.sys_syscall
libc.include.time
libc.include.sched
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sched

(all of these include are wrong)

libc.hdr.types.pid_t
libc.hdr.types.struct_sched_param
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
)
Expand All @@ -82,6 +94,8 @@ add_entrypoint_object(
libc.include.sys_syscall
libc.include.time
libc.include.sched
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sched

(all of these include are wrong)

libc.hdr.types.pid_t
libc.hdr.types.struct_sched_param
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
)
Expand All @@ -94,6 +108,7 @@ add_entrypoint_object(
../sched_getscheduler.h
DEPENDS
libc.include.sched
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sched

libc.hdr.types.pid_t
libc.include.sys_syscall
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sys_syscall

libc.src.__support.OSUtil.osutil
libc.src.errno.errno
Expand Down Expand Up @@ -132,6 +147,8 @@ add_entrypoint_object(
DEPENDS
libc.include.sys_syscall
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sys_syscall

libc.include.sched
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libc.include.sched

libc.hdr.types.pid_t
libc.hdr.types.struct_timespec
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
)
9 changes: 6 additions & 3 deletions libc/src/sched/linux/sched_getaffinity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
#include "src/sched/sched_getaffinity.h"

#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/common.h" // LLVM_LIBC_FUNCTION
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include "src/errno/libc_errno.h"

#include <sched.h>
#include "hdr/types/cpu_set_t.h"
#include "hdr/types/pid_t.h"
#include "hdr/types/size_t.h"

#include <stdint.h>
#include <sys/syscall.h> // For syscall numbers.

Expand Down
10 changes: 5 additions & 5 deletions libc/src/sched/linux/sched_getcpucount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

#include "src/sched/sched_getcpucount.h"

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

#include <sched.h>
#include <stddef.h>
#include "hdr/types/cpu_set_t.h"
#include "hdr/types/size_t.h"

namespace LIBC_NAMESPACE_DECL {

LLVM_LIBC_FUNCTION(int, __sched_getcpucount,
(size_t cpuset_size, const cpu_set_t *mask)) {
int result = 0;
for (size_t i = 0; i < cpuset_size / sizeof(long); ++i) {
result += __builtin_popcountl(mask->__mask[i]);
result += __builtin_popcountl(mask->__bits[i]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
return result;
}
Expand Down
7 changes: 5 additions & 2 deletions libc/src/sched/linux/sched_getparam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
#include "src/sched/sched_getparam.h"

#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/common.h" // LLVM_LIBC_FUNCTION
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include "src/errno/libc_errno.h"

#include "hdr/types/pid_t.h"
#include "hdr/types/struct_sched_param.h"

#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
6 changes: 4 additions & 2 deletions libc/src/sched/linux/sched_getscheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
#include "src/sched/sched_getscheduler.h"

#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/common.h" // LLVM_LIBC_FUNCTION
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include "src/errno/libc_errno.h"

#include "hdr/types/pid_t.h"

#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
7 changes: 5 additions & 2 deletions libc/src/sched/linux/sched_rr_get_interval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
#include "src/sched/sched_rr_get_interval.h"

#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/common.h" // LLVM_LIBC_FUNCTION
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include "src/errno/libc_errno.h"

#include "hdr/types/pid_t.h"
#include "hdr/types/struct_timespec.h"

#include <sys/syscall.h> // For syscall numbers.

#ifdef SYS_sched_rr_get_interval_time64
Expand Down
8 changes: 5 additions & 3 deletions libc/src/sched/linux/sched_setaffinity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
#include "src/sched/sched_setaffinity.h"

#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/common.h" // LLVM_LIBC_FUNCTION
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include "src/errno/libc_errno.h"

#include <sched.h>
#include "hdr/types/cpu_set_t.h"
#include "hdr/types/pid_t.h"
#include "hdr/types/size_t.h"
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
7 changes: 5 additions & 2 deletions libc/src/sched/linux/sched_setparam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
#include "src/sched/sched_setparam.h"

#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/common.h" // LLVM_LIBC_FUNCTION
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include "src/errno/libc_errno.h"

#include "hdr/types/pid_t.h"
#include "hdr/types/struct_sched_param.h"

#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
7 changes: 5 additions & 2 deletions libc/src/sched/linux/sched_setscheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
#include "src/sched/sched_setscheduler.h"

#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/common.h" // LLVM_LIBC_FUNCTION
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
#include "src/errno/libc_errno.h"

#include "hdr/types/pid_t.h"
#include "hdr/types/struct_sched_param.h"

#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
6 changes: 4 additions & 2 deletions libc/src/sched/sched_getaffinity.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
#ifndef LLVM_LIBC_SRC_SCHED_SCHED_GETAFFINITY_H
#define LLVM_LIBC_SRC_SCHED_SCHED_GETAFFINITY_H

#include "src/__support/macros/config.h"
#include <sched.h>
#include "hdr/types/cpu_set_t.h"
#include "hdr/types/pid_t.h"
#include "hdr/types/size_t.h"
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL

namespace LIBC_NAMESPACE_DECL {

Expand Down
6 changes: 3 additions & 3 deletions libc/src/sched/sched_getcpucount.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#ifndef LLVM_LIBC_SRC_SCHED_SCHED_GETCPUCOUNT_H
#define LLVM_LIBC_SRC_SCHED_SCHED_GETCPUCOUNT_H

#include "src/__support/macros/config.h"
#include <sched.h>
#include <stddef.h>
#include "hdr/types/cpu_set_t.h"
#include "hdr/types/size_t.h"
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL

namespace LIBC_NAMESPACE_DECL {

Expand Down
5 changes: 3 additions & 2 deletions libc/src/sched/sched_getparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
#ifndef LLVM_LIBC_SRC_SCHED_SCHED_GETPARAM_H
#define LLVM_LIBC_SRC_SCHED_SCHED_GETPARAM_H

#include "src/__support/macros/config.h"
#include <sched.h>
#include "hdr/types/pid_t.h"
#include "hdr/types/struct_sched_param.h"
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL

namespace LIBC_NAMESPACE_DECL {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/sched/sched_getscheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_SCHED_SCHED_GETSCHEDULER_H
#define LLVM_LIBC_SRC_SCHED_SCHED_GETSCHEDULER_H

#include "src/__support/macros/config.h"
#include <sched.h>
#include "hdr/types/pid_t.h"
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL

namespace LIBC_NAMESPACE_DECL {

Expand Down
5 changes: 3 additions & 2 deletions libc/src/sched/sched_rr_get_interval.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
#ifndef LLVM_LIBC_SRC_SCHED_SCHED_RR_GET_INTERVAL_H
#define LLVM_LIBC_SRC_SCHED_SCHED_RR_GET_INTERVAL_H

#include "src/__support/macros/config.h"
#include <sched.h>
#include "hdr/types/pid_t.h"
#include "hdr/types/struct_timespec.h"
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL

namespace LIBC_NAMESPACE_DECL {

Expand Down
Loading