Skip to content

Commit f16ecab

Browse files
[libc] Remove some sched.h includes
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 9b4a44d commit f16ecab

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
@@ -6,7 +6,9 @@ add_entrypoint_object(
66
../sched_getaffinity.h
77
DEPENDS
88
libc.hdr.stdint_proxy
9-
libc.include.sched
9+
libc.hdr.types.cpu_set_t
10+
libc.hdr.types.pid_t
11+
libc.hdr.types.size_t
1012
libc.src.__support.OSUtil.osutil
1113
libc.src.errno.errno
1214
)
@@ -18,7 +20,9 @@ add_entrypoint_object(
1820
HDRS
1921
../sched_setaffinity.h
2022
DEPENDS
21-
libc.include.sched
23+
libc.hdr.types.cpu_set_t
24+
libc.hdr.types.pid_t
25+
libc.hdr.types.size_t
2226
libc.src.__support.OSUtil.osutil
2327
libc.src.errno.errno
2428
)
@@ -30,7 +34,8 @@ add_entrypoint_object(
3034
HDRS
3135
../sched_getcpucount.h
3236
DEPENDS
33-
libc.include.sched
37+
libc.hdr.types.cpu_set_t
38+
libc.hdr.types.size_t
3439
)
3540

3641
add_entrypoint_object(
@@ -94,7 +99,7 @@ add_entrypoint_object(
9499
HDRS
95100
../sched_getscheduler.h
96101
DEPENDS
97-
libc.include.sched
102+
libc.hdr.types.pid_t
98103
libc.include.sys_syscall
99104
libc.src.__support.OSUtil.osutil
100105
libc.src.errno.errno
@@ -131,8 +136,9 @@ add_entrypoint_object(
131136
HDRS
132137
../sched_rr_get_interval.h
133138
DEPENDS
139+
libc.hdr.types.pid_t
140+
libc.hdr.types.struct_timespec
134141
libc.include.sys_syscall
135-
libc.include.sched
136142
libc.src.__support.OSUtil.osutil
137143
libc.src.errno.errno
138144
)

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)