[libc-commits] [libc] [libc] Remove full header dependencies from proxy header targets (PR #234150)

via libc-commits libc-commits at lists.llvm.org
Wed Oct 21 03:55:42 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Pavel Labath (labath)

<details>
<summary>Changes</summary>

In full-build mode, the proxy headers in libc/hdr/types/ only include the granular type headers (include/llvm-libc-types/*.h), not the top- level public headers (which are only included in overlay mode). Having FULL_BUILD_DEPENDS point at libc.include.<header> was unnecessary and forced full header generation before building internal targets that only needed a single type.

Similarly, the function proxy headers in libc/hdr/func/ only include include/__llvm-libc-common.h in full-build mode, so I've replaced their dependency on libc.include.stdlib with libc.include.llvm_libc_common_h.

Removing these uncovered a few missing or broken dependencies that were previously satisfied transitively:
- atexithandler_t depended on the non-existent target libc.include.llvm-libc-types.atexithandler_t instead of libc.include.llvm-libc-types.__atexithandler_t (masked by libc.include.stdlib)
- hsearch_r.h directly included <search.h> for struct hsearch_data (masked by the ACTION and ENTRY proxy headers), which I've replaced with the granular struct_hsearch_data.h header
- faccessat_test, select_ui_test, and select_failure_test directly included <fcntl.h> and <sys/select.h> without declaring dependencies on them (masked by the mode_t and fd_set proxy headers), which I've switched to use the corresponding proxy headers

Assisted-by: Gemini

---
Full diff: https://github.com/llvm/llvm-project/pull/234150.diff


9 Files Affected:

- (modified) libc/hdr/func/CMakeLists.txt (+4-4) 
- (modified) libc/hdr/types/CMakeLists.txt (+1-70) 
- (modified) libc/src/search/CMakeLists.txt (+1) 
- (modified) libc/src/search/hsearch_r.h (+1-1) 
- (modified) libc/test/src/sys/select/CMakeLists.txt (+6) 
- (modified) libc/test/src/sys/select/select_failure_test.cpp (+3-1) 
- (modified) libc/test/src/sys/select/select_ui_test.cpp (+3-1) 
- (modified) libc/test/src/unistd/CMakeLists.txt (+1) 
- (modified) libc/test/src/unistd/faccessat_test.cpp (+1-1) 


``````````diff
diff --git a/libc/hdr/func/CMakeLists.txt b/libc/hdr/func/CMakeLists.txt
index 608bab5ae1e95d..fefaa30065d7e2 100644
--- a/libc/hdr/func/CMakeLists.txt
+++ b/libc/hdr/func/CMakeLists.txt
@@ -5,7 +5,7 @@ add_proxy_header_library(
   DEPENDS
     libc.hdr.stdlib_overlay
   FULL_BUILD_DEPENDS
-    libc.include.stdlib
+    libc.include.llvm_libc_common_h
     libc.hdr.types.size_t
 )
 
@@ -16,7 +16,7 @@ add_proxy_header_library(
   DEPENDS
     libc.hdr.stdlib_overlay
   FULL_BUILD_DEPENDS
-    libc.include.stdlib
+    libc.include.llvm_libc_common_h
     libc.hdr.types.size_t
 )
 
@@ -27,7 +27,7 @@ add_proxy_header_library(
   DEPENDS
     libc.hdr.stdlib_overlay
   FULL_BUILD_DEPENDS
-    libc.include.stdlib
+    libc.include.llvm_libc_common_h
     libc.hdr.types.size_t
 )
 
@@ -38,5 +38,5 @@ add_proxy_header_library(
   DEPENDS
     libc.hdr.stdlib_overlay
   FULL_BUILD_DEPENDS
-    libc.include.stdlib
+    libc.include.llvm_libc_common_h
 )
diff --git a/libc/hdr/types/CMakeLists.txt b/libc/hdr/types/CMakeLists.txt
index 605540a10dbb87..ce691026238eeb 100644
--- a/libc/hdr/types/CMakeLists.txt
+++ b/libc/hdr/types/CMakeLists.txt
@@ -6,7 +6,6 @@ add_proxy_header_library(
     libc.hdr.uchar_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.char8_t
-    libc.include.uchar
 )
 
 add_proxy_header_library(
@@ -17,7 +16,6 @@ add_proxy_header_library(
     libc.hdr.uchar_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.char32_t
-    libc.include.uchar
 )
 
 add_proxy_header_library(
@@ -26,7 +24,6 @@ add_proxy_header_library(
     mbstate_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.mbstate_t
-    libc.include.uchar
 )
 
 add_proxy_header_library(
@@ -45,7 +42,6 @@ add_proxy_header_library(
     libc.hdr.stdlib_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.div_t
-    libc.include.stdlib
 )
 
 add_proxy_header_library(
@@ -88,7 +84,6 @@ add_proxy_header_library(
     libc.hdr.stdlib_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.ldiv_t
-    libc.include.stdlib
 )
 
 add_proxy_header_library(
@@ -99,7 +94,6 @@ add_proxy_header_library(
     libc.hdr.stdlib_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.lldiv_t
-    libc.include.stdlib
 )
 
 add_proxy_header_library(
@@ -272,7 +266,6 @@ add_proxy_header_library(
     libc.hdr.fcntl_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.mode_t
-    libc.include.fcntl
 )
 
 add_proxy_header_library(
@@ -297,7 +290,6 @@ add_proxy_header_library(
     fd_set.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.fd_set
-    libc.include.sys_select
 )
 
 add_proxy_header_library(
@@ -306,7 +298,6 @@ add_proxy_header_library(
     fenv_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.fenv_t
-    libc.include.fenv
 )
 
 add_proxy_header_library(
@@ -315,7 +306,6 @@ add_proxy_header_library(
     fexcept_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.fexcept_t
-    libc.include.fenv
 )
 
 add_proxy_header_library(
@@ -324,7 +314,6 @@ add_proxy_header_library(
     time_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.time_t
-    libc.include.time
 )
 
 add_proxy_header_library(
@@ -333,7 +322,6 @@ add_proxy_header_library(
     timer_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.timer_t
-    libc.include.time
 )
 
 add_proxy_header_library(
@@ -350,7 +338,6 @@ add_proxy_header_library(
     clock_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.clock_t
-    libc.include.time
 )
 
 add_proxy_header_library(
@@ -359,7 +346,6 @@ add_proxy_header_library(
     suseconds_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.suseconds_t
-    libc.include.sys_time
 )
 
 add_proxy_header_library(
@@ -376,7 +362,6 @@ add_proxy_header_library(
     struct_timeval.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_timeval
-    libc.include.sys_time
 )
 
 add_proxy_header_library(
@@ -385,7 +370,6 @@ add_proxy_header_library(
     struct_itimerval.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_itimerval
-    libc.include.sys_time
 )
 
 add_proxy_header_library(
@@ -394,7 +378,6 @@ add_proxy_header_library(
     key_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.key_t
-    libc.include.sys_ipc
 )
 
 add_proxy_header_library(
@@ -443,7 +426,6 @@ add_proxy_header_library(
     pthread_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.pthread_t
-    libc.include.pthread
 )
 
 add_proxy_header_library(
@@ -451,8 +433,7 @@ add_proxy_header_library(
   HDRS
     atexithandler_t.h
   FULL_BUILD_DEPENDS
-    libc.include.llvm-libc-types.atexithandler_t
-    libc.include.stdlib
+    libc.include.llvm-libc-types.__atexithandler_t
 )
 
 add_proxy_header_library(
@@ -461,7 +442,6 @@ add_proxy_header_library(
     struct_sigaction.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_sigaction
-    libc.include.signal
 )
 
 add_proxy_header_library(
@@ -480,7 +460,6 @@ add_proxy_header_library(
     libc.hdr.stdio_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.FILE
-    libc.include.stdio
 )
 
 add_proxy_header_library(
@@ -501,7 +480,6 @@ add_proxy_header_library(
     libc.hdr.stdio_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.off_t
-    libc.include.stdio
 )
 
 add_proxy_header_library(
@@ -522,7 +500,6 @@ add_proxy_header_library(
     libc.hdr.stdio_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.cookie_io_functions_t
-    libc.include.stdio
 )
 
 add_proxy_header_library(
@@ -531,7 +508,6 @@ add_proxy_header_library(
     locale_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.locale_t
-    libc.include.locale
 )
 
 add_proxy_header_library(
@@ -540,7 +516,6 @@ add_proxy_header_library(
     stack_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.stack_t
-    libc.include.signal
 )
 
 add_proxy_header_library(
@@ -549,7 +524,6 @@ add_proxy_header_library(
     jmp_buf.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.jmp_buf
-    libc.include.setjmp
 )
 
 add_proxy_header_library(
@@ -558,7 +532,6 @@ add_proxy_header_library(
     sigjmp_buf.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.sigjmp_buf
-    libc.include.setjmp
 )
 
 add_proxy_header_library(
@@ -569,7 +542,6 @@ add_proxy_header_library(
     libc.hdr.sys_socket_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_linger
-    libc.include.sys_socket
 )
 
 add_proxy_header_library(
@@ -580,7 +552,6 @@ add_proxy_header_library(
     libc.hdr.sys_socket_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_cmsghdr
-    libc.include.sys_socket
 )
 
 add_proxy_header_library(
@@ -591,7 +562,6 @@ add_proxy_header_library(
     libc.hdr.sys_socket_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_mmsghdr
-    libc.include.sys_socket
 )
 
 add_proxy_header_library(
@@ -602,7 +572,6 @@ add_proxy_header_library(
     libc.hdr.sys_socket_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_msghdr
-    libc.include.sys_socket
 )
 
 add_proxy_header_library(
@@ -611,7 +580,6 @@ add_proxy_header_library(
     struct_in_addr.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_in_addr
-    libc.include.arpa_inet
 )
 
 add_proxy_header_library(
@@ -620,7 +588,6 @@ add_proxy_header_library(
     struct_in6_addr.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_in6_addr
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -629,7 +596,6 @@ add_proxy_header_library(
     struct_ip_mreq.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_ip_mreq
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -638,7 +604,6 @@ add_proxy_header_library(
     struct_ip_mreq_source.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_ip_mreq_source
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -647,7 +612,6 @@ add_proxy_header_library(
     struct_ip_mreqn.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_ip_mreqn
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -656,7 +620,6 @@ add_proxy_header_library(
     struct_ip_msfilter.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_ip_msfilter
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -665,7 +628,6 @@ add_proxy_header_library(
     struct_group_req.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_group_req
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -674,7 +636,6 @@ add_proxy_header_library(
     struct_group_source_req.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_group_source_req
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -683,7 +644,6 @@ add_proxy_header_library(
     struct_ip_opts.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_ip_opts
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -692,7 +652,6 @@ add_proxy_header_library(
     struct_ipv6_mreq.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_ipv6_mreq
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -701,7 +660,6 @@ add_proxy_header_library(
     in_addr_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.in_addr_t
-    libc.include.arpa_inet
 )
 
 add_proxy_header_library(
@@ -710,7 +668,6 @@ add_proxy_header_library(
     struct_ifreq.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_ifreq
-    libc.include.net_if
 )
 
 add_proxy_header_library(
@@ -719,7 +676,6 @@ add_proxy_header_library(
     struct_if_nameindex.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_if_nameindex
-    libc.include.net_if
 )
 
 add_proxy_header_library(
@@ -730,7 +686,6 @@ add_proxy_header_library(
     libc.hdr.sys_socket_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_sockaddr
-    libc.include.sys_socket
 )
 
 add_proxy_header_library(
@@ -749,7 +704,6 @@ add_proxy_header_library(
     libc.hdr.sys_socket_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_sockaddr_storage
-    libc.include.sys_socket
 )
 
 add_proxy_header_library(
@@ -758,7 +712,6 @@ add_proxy_header_library(
     struct_sockaddr_un.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_sockaddr_un
-    libc.include.sys_socket
 )
 
 add_proxy_header_library(
@@ -767,7 +720,6 @@ add_proxy_header_library(
     struct_sockaddr_in.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_sockaddr_in
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -776,7 +728,6 @@ add_proxy_header_library(
     struct_sockaddr_in6.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_sockaddr_in6
-    libc.include.netinet_in
 )
 
 add_proxy_header_library(
@@ -785,7 +736,6 @@ add_proxy_header_library(
     struct_udphdr.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_udphdr
-    libc.include.netinet_udp
 )
 
 add_proxy_header_library(
@@ -794,7 +744,6 @@ add_proxy_header_library(
     struct_sysinfo.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_sysinfo
-    libc.include.sys_sysinfo
 )
 
 add_proxy_header_library(
@@ -803,7 +752,6 @@ add_proxy_header_library(
     struct_utsname.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_utsname
-    libc.include.sys_utsname
 )
 
 add_proxy_header_library(
@@ -814,7 +762,6 @@ add_proxy_header_library(
     libc.hdr.sys_socket_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.sa_family_t
-    libc.include.sys_socket
 )
 
 add_proxy_header_library(
@@ -825,7 +772,6 @@ add_proxy_header_library(
     libc.hdr.sys_socket_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.socklen_t
-    libc.include.sys_socket
 )
 
 add_proxy_header_library(
@@ -836,7 +782,6 @@ add_proxy_header_library(
     libc.hdr.wchar_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.wchar_t
-    libc.include.wchar
 )
 
 add_proxy_header_library(
@@ -847,7 +792,6 @@ add_proxy_header_library(
     libc.hdr.wchar_overlay
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.wint_t
-    libc.include.wchar
 )
 
 add_proxy_header_library(
@@ -872,7 +816,6 @@ add_proxy_header_library(
     struct_iovec.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_iovec
-    libc.include.sys_uio
 )
 
 add_proxy_header_library(
@@ -901,7 +844,6 @@ add_proxy_header_library(
     cpu_set_t.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.cpu_set_t
-    libc.include.sched
 )
 
 add_proxy_header_library(
@@ -910,7 +852,6 @@ add_proxy_header_library(
     ENTRY.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.ENTRY
-    libc.include.search
 )
 
 add_proxy_header_library(
@@ -919,7 +860,6 @@ add_proxy_header_library(
     ACTION.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.ACTION
-    libc.include.search
 )
 
 add_proxy_header_library(
@@ -928,7 +868,6 @@ add_proxy_header_library(
     struct_sched_param.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_sched_param
-    libc.include.sched
 )
 
 add_proxy_header_library(
@@ -937,7 +876,6 @@ add_proxy_header_library(
     dl_info.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.dl_info
-    libc.include.dlfcn
 )
 
 add_proxy_header_library(
@@ -946,7 +884,6 @@ add_proxy_header_library(
     struct_rlimit.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_rlimit
-    libc.include.sys_resource
 )
 
 add_proxy_header_library(
@@ -955,7 +892,6 @@ add_proxy_header_library(
     struct_rusage.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_rusage
-    libc.include.sys_resource
 )
 
 add_proxy_header_library(
@@ -964,7 +900,6 @@ add_proxy_header_library(
     struct_semid_ds.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_semid_ds
-    libc.include.sys_sem
 )
 
 add_proxy_header_library(
@@ -973,7 +908,6 @@ add_proxy_header_library(
     struct_sembuf.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_sembuf
-    libc.include.sys_sem
 )
 
 add_proxy_header_library(
@@ -982,7 +916,6 @@ add_proxy_header_library(
     struct_seminfo.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.struct_seminfo
-    libc.include.sys_sem
 )
 
 add_proxy_header_library(
@@ -1359,7 +1292,6 @@ add_proxy_header_library(
     posix_tnode.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.posix_tnode
-    libc.include.search
 )
 
 add_proxy_header_library(
@@ -1368,7 +1300,6 @@ add_proxy_header_library(
     VISIT.h
   FULL_BUILD_DEPENDS
     libc.include.llvm-libc-types.VISIT
-    libc.include.search
 )
 
 add_proxy_header_library(
diff --git a/libc/src/search/CMakeLists.txt b/libc/src/search/CMakeLists.txt
index c59769cba2de72..a872515b9af45f 100644
--- a/libc/src/search/CMakeLists.txt
+++ b/libc/src/search/CMakeLists.txt
@@ -51,6 +51,7 @@ add_entrypoint_object(
   DEPENDS
     libc.hdr.types.ACTION
     libc.hdr.types.ENTRY
+    libc.include.llvm-libc-types.struct_hsearch_data
     libc.src.__support.HashTable.table
     libc.src.errno.errno
 )
diff --git a/libc/src/search/hsearch_r.h b/libc/src/search/hsearch_r.h
index 98f956fc6c6a7f..692bc3cb5f370a 100644
--- a/libc/src/search/hsearch_r.h
+++ b/libc/src/search/hsearch_r.h
@@ -11,8 +11,8 @@
 
 #include "hdr/types/ACTION.h"
 #include "hdr/types/ENTRY.h"
+#include "include/llvm-libc-types/struct_hsearch_data.h"
 #include "src/__support/macros/config.h"
-#include <search.h> // hsearch_data
 
 namespace LIBC_NAMESPACE_DECL {
 int hsearch_r(ENTRY item, ACTION action, ENTRY **retval,
diff --git a/libc/test/src/sys/select/CMakeLists.txt b/libc/test/src/sys/select/CMakeLists.txt
index 7d9fa2e28628fc..e20fe0000edc9a 100644
--- a/libc/test/src/sys/select/CMakeLists.txt
+++ b/libc/test/src/sys/select/CMakeLists.txt
@@ -8,6 +8,9 @@ add_libc_test(
   SRCS
     select_ui_test.cpp
   DEPENDS
+    libc.hdr.sys_select_macros
+    libc.hdr.types.fd_set
+    libc.hdr.types.struct_timeval
     libc.include.unistd
     libc.src.errno.errno
     libc.src.sys.select.select
@@ -23,6 +26,9 @@ add_libc_test(
   SRCS
     select_failure_test.cpp
   DEPENDS
+    libc.hdr.sys_select_macros
+    libc.hdr.types.fd_set
+    libc.hdr.types.struct_timeval
     libc.include.unistd
     libc.src.errno.errno
     libc.src.sys.select.select
diff --git a/libc/test/src/sys/select/select_failure_test.cpp b/libc/test/src/sys/select/select_failure_test.cpp
index c5a7ad7a11a353..f83248afee6058 100644
--- a/libc/test/src/sys/select/select_failure_test.cpp
+++ b/libc/test/src/sys/select/select_failure_test.cpp
@@ -6,13 +6,15 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/sys_select_macros.h"
+#include "hdr/types/fd_set.h"
+#include "hdr/types/struct_timeval.h"
 #include "src/sys/select/select.h"
 #include "src/unistd/read.h"
 #include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include <sys/select.h>
 #include <unistd.h>
 
 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
diff --git a/libc/test/src/sys/select/select_ui_test.cpp b/libc/test/src/sys/select/select_ui_test.cpp
index f2e1786d56c884..c9c516151a5ba1 100644
--- a/libc/test/src/sys/select/select_ui_test.cpp
+++ b/libc/test/src/sys/select/select_ui_test.cpp
@@ -6,13 +6,15 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/sys_select_macros.h"
+#include "hdr/types/fd_set.h"
+#include "hdr/types/struct_timeval.h"
 #include "src/sys/select/select.h"
 #include "src/unistd/read.h"
 #include "test/UnitTest/ErrnoCheckingTest.h"
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include <sys/select.h>
 #include <unistd.h>
 
 using namespace LIBC_NAMESPACE::testing::ErrnoSetterMatcher;
diff --git a/libc/test/src/unistd/CMakeLists.txt b/libc/test/src/unistd/CMakeLists.txt
index 08e42e3fe4c643..900f63a3469e99 100644
--- a/libc/test/src/unistd/CMakeLists.txt
+++ b/libc/test/src/unistd/CMakeLists.txt
@@ -156,6 +156,7 @@ add_libc_test(
   SRCS
     faccessat_test.cpp
   DEPENDS
+    libc.hdr.fcntl_macros
     libc.hdr.sys_stat_macros
     libc.include.unistd
     libc.src.errno.errno
diff --git a/libc/test/src/unistd/faccessat_test.cpp b/libc/test/src/unistd/faccessat_test.cpp
index ca4e19f1aec753..7b2e041de74af3 100644
--- a/libc/test/src/unistd/faccessat_test.cpp
+++ b/libc/test/src/unistd/faccessat_test.cpp
@@ -6,6 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "hdr/fcntl_macros.h"
 #include "hdr/sys_stat_macros.h"
 #include "src/fcntl/open.h"
 #include "src/unistd/close.h"
@@ -15,7 +16,6 @@
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include <fcntl.h>
 #include <unistd.h>
 
 namespace {

``````````

</details>


https://github.com/llvm/llvm-project/pull/234150


More information about the libc-commits mailing list