Skip to content

Commit 27cc35b

Browse files
boomanaiden154krishna2803
authored andcommitted
[libc] Remove some sched.h includes (llvm#151425)
This patch removes some sched.h includes, preferring the proxy headers. This patch does not clean them all up as some proxy type headers need to be added, like for `struct sched_param`.
1 parent 6cddfcb commit 27cc35b

16 files changed

+51
-22
lines changed

libc/src/sched/linux/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ add_entrypoint_object(
1818
../sched_getaffinity.h
1919
DEPENDS
2020
libc.hdr.stdint_proxy
21-
libc.include.sched
21+
libc.hdr.types.cpu_set_t
22+
libc.hdr.types.pid_t
23+
libc.hdr.types.size_t
2224
libc.src.__support.OSUtil.osutil
2325
libc.src.errno.errno
2426
)
@@ -30,7 +32,9 @@ add_entrypoint_object(
3032
HDRS
3133
../sched_setaffinity.h
3234
DEPENDS
33-
libc.include.sched
35+
libc.hdr.types.cpu_set_t
36+
libc.hdr.types.pid_t
37+
libc.hdr.types.size_t
3438
libc.src.__support.OSUtil.osutil
3539
libc.src.errno.errno
3640
)
@@ -42,7 +46,8 @@ add_entrypoint_object(
4246
HDRS
4347
../sched_getcpucount.h
4448
DEPENDS
45-
libc.include.sched
49+
libc.hdr.types.cpu_set_t
50+
libc.hdr.types.size_t
4651
)
4752

4853
add_entrypoint_object(
@@ -106,7 +111,7 @@ add_entrypoint_object(
106111
HDRS
107112
../sched_getscheduler.h
108113
DEPENDS
109-
libc.include.sched
114+
libc.hdr.types.pid_t
110115
libc.include.sys_syscall
111116
libc.src.__support.OSUtil.osutil
112117
libc.src.errno.errno
@@ -143,8 +148,9 @@ add_entrypoint_object(
143148
HDRS
144149
../sched_rr_get_interval.h
145150
DEPENDS
151+
libc.hdr.types.pid_t
152+
libc.hdr.types.struct_timespec
146153
libc.include.sys_syscall
147-
libc.include.sched
148154
libc.src.__support.OSUtil.osutil
149155
libc.src.errno.errno
150156
)

libc/src/sched/linux/sched_getaffinity.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
#include "src/__support/libc_errno.h"
1515
#include "src/__support/macros/config.h"
1616

17-
#include <sched.h>
17+
#include "hdr/types/cpu_set_t.h"
18+
#include "hdr/types/pid_t.h"
19+
#include "hdr/types/size_t.h"
1820
#include <sys/syscall.h> // For syscall numbers.
1921

2022
namespace LIBC_NAMESPACE_DECL {

libc/src/sched/linux/sched_getcpucount.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
#include "src/__support/common.h"
1313
#include "src/__support/macros/config.h"
1414

15-
#include <sched.h>
15+
#include "hdr/types/cpu_set_t.h"
16+
#include "hdr/types/size_t.h"
1617
#include <stddef.h>
1718

1819
namespace LIBC_NAMESPACE_DECL {

libc/src/sched/linux/sched_getscheduler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "src/__support/libc_errno.h"
1414
#include "src/__support/macros/config.h"
1515

16+
#include "hdr/types/pid_t.h"
1617
#include <sys/syscall.h> // For syscall numbers.
1718

1819
namespace LIBC_NAMESPACE_DECL {

libc/src/sched/linux/sched_rr_get_interval.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include "src/__support/libc_errno.h"
1414
#include "src/__support/macros/config.h"
1515

16+
#include "hdr/types/pid_t.h"
17+
#include "hdr/types/struct_timespec.h"
1618
#include <sys/syscall.h> // For syscall numbers.
1719

1820
#ifdef SYS_sched_rr_get_interval_time64

libc/src/sched/linux/sched_setaffinity.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
#include "src/__support/libc_errno.h"
1414
#include "src/__support/macros/config.h"
1515

16-
#include <sched.h>
16+
#include "hdr/types/cpu_set_t.h"
17+
#include "hdr/types/pid_t.h"
18+
#include "hdr/types/size_t.h"
1719
#include <sys/syscall.h> // For syscall numbers.
1820

1921
namespace LIBC_NAMESPACE_DECL {

libc/src/sched/sched_getaffinity.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
#define LLVM_LIBC_SRC_SCHED_SCHED_GETAFFINITY_H
1111

1212
#include "src/__support/macros/config.h"
13-
#include <sched.h>
13+
14+
#include "hdr/types/cpu_set_t.h"
15+
#include "hdr/types/pid_t.h"
16+
#include "hdr/types/size_t.h"
1417

1518
namespace LIBC_NAMESPACE_DECL {
1619

libc/src/sched/sched_getcpucount.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
#define LLVM_LIBC_SRC_SCHED_SCHED_GETCPUCOUNT_H
1111

1212
#include "src/__support/macros/config.h"
13-
#include <sched.h>
13+
14+
#include "hdr/types/cpu_set_t.h"
1415
#include <stddef.h>
1516

1617
namespace LIBC_NAMESPACE_DECL {

libc/src/sched/sched_getscheduler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
#define LLVM_LIBC_SRC_SCHED_SCHED_GETSCHEDULER_H
1111

1212
#include "src/__support/macros/config.h"
13-
#include <sched.h>
13+
14+
#include "hdr/types/pid_t.h"
1415

1516
namespace LIBC_NAMESPACE_DECL {
1617

libc/src/sched/sched_rr_get_interval.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
#define LLVM_LIBC_SRC_SCHED_SCHED_RR_GET_INTERVAL_H
1111

1212
#include "src/__support/macros/config.h"
13-
#include <sched.h>
13+
14+
#include "hdr/types/pid_t.h"
15+
#include "hdr/types/struct_timespec.h"
1416

1517
namespace LIBC_NAMESPACE_DECL {
1618

0 commit comments

Comments
 (0)