21 changes: 11 additions & 10 deletions libc/src/unistd/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ add_entrypoint_object(
HDRS
../access.h
DEPENDS
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand Down Expand Up @@ -57,7 +58,7 @@ add_entrypoint_object(
HDRS
../dup2.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand Down Expand Up @@ -254,7 +255,7 @@ add_entrypoint_object(
HDRS
../link.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand All @@ -268,7 +269,7 @@ add_entrypoint_object(
HDRS
../linkat.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand Down Expand Up @@ -377,7 +378,7 @@ add_entrypoint_object(
HDRS
../rmdir.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand All @@ -391,7 +392,7 @@ add_entrypoint_object(
HDRS
../readlink.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand All @@ -405,7 +406,7 @@ add_entrypoint_object(
HDRS
../readlinkat.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand All @@ -419,7 +420,7 @@ add_entrypoint_object(
HDRS
../symlink.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand All @@ -433,7 +434,7 @@ add_entrypoint_object(
HDRS
../symlinkat.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand Down Expand Up @@ -485,7 +486,7 @@ add_entrypoint_object(
HDRS
../unlink.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand All @@ -499,7 +500,7 @@ add_entrypoint_object(
HDRS
../unlinkat.h
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "hdr/fcntl_macros.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/dup2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "hdr/fcntl_macros.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/linkat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "hdr/fcntl_macros.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/readlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "hdr/fcntl_macros.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/readlinkat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "hdr/fcntl_macros.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/rmdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/symlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/symlinkat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "hdr/fcntl_macros.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/unlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"

#include "hdr/fcntl_macros.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <fcntl.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/unlinkat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/fcntl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ add_libc_unittest(
SRCS
openat_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.src.errno.errno
libc.src.fcntl.open
libc.src.fcntl.openat
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/fcntl/openat_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"

TEST(LlvmLibcUniStd, OpenAndReadTest) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/sys/sendfile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ add_libc_unittest(
SRCS
sendfile_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.sys_stat
libc.src.errno.errno
libc.src.fcntl.open
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/sys/sendfile/sendfile_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/stat.h>

namespace cpp = LIBC_NAMESPACE::cpp;
Expand Down
14 changes: 7 additions & 7 deletions libc/test/src/sys/stat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ add_libc_unittest(
SRCS
chmod_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.sys_stat
libc.src.errno.errno
libc.src.fcntl.open
Expand All @@ -25,7 +25,7 @@ add_libc_unittest(
SRCS
fchmodat_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.sys_stat
libc.src.errno.errno
libc.src.fcntl.open
Expand All @@ -41,7 +41,7 @@ add_libc_unittest(
SRCS
fchmod_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.sys_stat
libc.src.errno.errno
libc.src.fcntl.open
Expand All @@ -57,7 +57,7 @@ add_libc_unittest(
SRCS
mkdirat_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.sys_stat
libc.src.errno.errno
libc.src.sys.stat.mkdirat
Expand All @@ -71,7 +71,7 @@ add_libc_unittest(
SRCS
stat_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.sys_stat
libc.src.errno.errno
libc.src.sys.stat.stat
Expand All @@ -87,7 +87,7 @@ add_libc_unittest(
SRCS
lstat_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.sys_stat
libc.src.errno.errno
libc.src.sys.stat.lstat
Expand All @@ -103,7 +103,7 @@ add_libc_unittest(
SRCS
fstat_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.sys_stat
libc.src.errno.errno
libc.src.sys.stat.fstat
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/sys/stat/chmod_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/stat.h>

TEST(LlvmLibcChmodTest, ChangeAndOpen) {
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/sys/stat/fchmod_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/stat.h>

TEST(LlvmLibcChmodTest, ChangeAndOpen) {
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/sys/stat/fchmodat_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/stat.h>

TEST(LlvmLibcFchmodatTest, ChangeAndOpen) {
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/sys/stat/fstat_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/stat.h>

TEST(LlvmLibcFStatTest, CreatAndReadMode) {
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/sys/stat/lstat_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/stat.h>

TEST(LlvmLibcLStatTest, CreatAndReadMode) {
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/sys/stat/mkdirat_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"

TEST(LlvmLibcMkdiratTest, CreateAndRemove) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/sys/stat/stat_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/stat.h>

TEST(LlvmLibcStatTest, CreatAndReadMode) {
Expand Down
9 changes: 5 additions & 4 deletions libc/test/src/unistd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ add_libc_unittest(
SRCS
chdir_test.cpp
DEPENDS
libc.hdr.fcntl_macros
libc.include.unistd
libc.src.errno.errno
libc.src.fcntl.open
libc.src.unistd.chdir
libc.src.unistd.close
libc.src.fcntl.open
libc.test.UnitTest.ErrnoSetterMatcher
)

Expand Down Expand Up @@ -223,7 +224,7 @@ add_libc_unittest(
SRCS
rmdir_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.src.errno.errno
libc.src.sys.stat.mkdir
libc.src.unistd.rmdir
Expand Down Expand Up @@ -262,7 +263,7 @@ add_libc_unittest(
SRCS
readlinkat_test.cpp
DEPENDS
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.unistd
libc.src.errno.errno
libc.src.unistd.readlinkat
Expand Down Expand Up @@ -410,7 +411,7 @@ add_libc_unittest(
syscall_test.cpp
DEPENDS
libc.include.unistd
libc.include.fcntl
libc.hdr.fcntl_macros
libc.include.sys_syscall
libc.src.errno.errno
libc.src.unistd.__llvm_libc_syscall
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/unistd/chdir_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"

TEST(LlvmLibcChdirTest, ChangeAndOpen) {
// The idea of this test is that we will first open an existing test file
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/unistd/fchdir_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"

TEST(LlvmLibcChdirTest, ChangeAndOpen) {
// The idea of this test is that we will first open an existing test file
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/unistd/readlinkat_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"

namespace cpp = LIBC_NAMESPACE::cpp;

Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/unistd/rmdir_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"

TEST(LlvmLibcRmdirTest, CreateAndRemove) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/unistd/syscall_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"

#include <fcntl.h>
#include "hdr/fcntl_macros.h"
#include <sys/stat.h> // For S_* flags.
#include <sys/syscall.h> // For syscall numbers.
#include <unistd.h>
Expand Down