[libc-commits] [libc] [libc] stop including unistd.h in src/ (PR #85971)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Wed Mar 20 10:29:14 PDT 2024


https://github.com/nickdesaulniers updated https://github.com/llvm/llvm-project/pull/85971

>From 39ab961498ae823d8e9cf5c23014ce9d545e5270 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 20 Mar 2024 10:19:45 -0700
Subject: [PATCH 1/3] [libc] stop including unistd.h in src/

It's not hermetic to include the system libc's headers and is one of the
reasons why our linter bot has been very red for a long time.

This is starting to be an issue for new contributors as well, since we're now
getting conflicts between the parts of our codebase that are hermetic, vs parts
that aren't.

I need to think about a rule of thumb or policy that can be publicly documented
so that we don't backslide.

I should probably clean up test/ as well, but let's clean up just src/ to
unblock fellow contributors.

Link: https://github.com/llvm/llvm-project/pull/85514#discussion_r1532078163
---
 libc/src/unistd/dup.h                | 2 --
 libc/src/unistd/dup2.h               | 2 --
 libc/src/unistd/dup3.h               | 2 --
 libc/src/unistd/fork.h               | 2 +-
 libc/src/unistd/ftruncate.h          | 2 +-
 libc/src/unistd/getcwd.h             | 2 +-
 libc/src/unistd/geteuid.h            | 2 +-
 libc/src/unistd/getopt.h             | 4 ++--
 libc/src/unistd/getpid.h             | 2 +-
 libc/src/unistd/getppid.h            | 2 +-
 libc/src/unistd/getuid.h             | 2 +-
 libc/src/unistd/isatty.h             | 2 --
 libc/src/unistd/link.h               | 2 --
 libc/src/unistd/linux/ftruncate.cpp  | 4 ++--
 libc/src/unistd/linux/lseek.cpp      | 4 ++--
 libc/src/unistd/linux/readlink.cpp   | 4 +++-
 libc/src/unistd/linux/readlinkat.cpp | 4 +++-
 libc/src/unistd/linux/sysconf.cpp    | 3 +--
 libc/src/unistd/linux/truncate.cpp   | 2 +-
 libc/src/unistd/lseek.h              | 2 +-
 libc/src/unistd/pread.h              | 4 +++-
 libc/src/unistd/pwrite.h             | 4 +++-
 libc/src/unistd/read.h               | 3 ++-
 libc/src/unistd/readlink.h           | 3 ++-
 libc/src/unistd/readlinkat.h         | 3 ++-
 libc/src/unistd/swab.h               | 2 +-
 libc/src/unistd/symlink.h            | 2 --
 libc/src/unistd/symlinkat.h          | 2 --
 libc/src/unistd/syscall.h            | 3 ---
 libc/src/unistd/sysconf.h            | 2 --
 libc/src/unistd/truncate.h           | 2 +-
 libc/src/unistd/write.h              | 3 ++-
 32 files changed, 38 insertions(+), 46 deletions(-)

diff --git a/libc/src/unistd/dup.h b/libc/src/unistd/dup.h
index d6daa5a9ad74d5..786aa8a3401a07 100644
--- a/libc/src/unistd/dup.h
+++ b/libc/src/unistd/dup.h
@@ -9,8 +9,6 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_DUP_H
 #define LLVM_LIBC_SRC_UNISTD_DUP_H
 
-#include <unistd.h>
-
 namespace LIBC_NAMESPACE {
 
 int dup(int fd);
diff --git a/libc/src/unistd/dup2.h b/libc/src/unistd/dup2.h
index ba8c5f4b160103..669dcb6bfb4819 100644
--- a/libc/src/unistd/dup2.h
+++ b/libc/src/unistd/dup2.h
@@ -9,8 +9,6 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_DUP2_H
 #define LLVM_LIBC_SRC_UNISTD_DUP2_H
 
-#include <unistd.h>
-
 namespace LIBC_NAMESPACE {
 
 int dup2(int oldfd, int newfd);
diff --git a/libc/src/unistd/dup3.h b/libc/src/unistd/dup3.h
index 2b1082403daff7..fe81452cce65ca 100644
--- a/libc/src/unistd/dup3.h
+++ b/libc/src/unistd/dup3.h
@@ -9,8 +9,6 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_DUP3_H
 #define LLVM_LIBC_SRC_UNISTD_DUP3_H
 
-#include <unistd.h>
-
 namespace LIBC_NAMESPACE {
 
 int dup3(int oldfd, int newfd, int flags);
diff --git a/libc/src/unistd/fork.h b/libc/src/unistd/fork.h
index 6b1b72a7dfc089..1fc97c2383eb88 100644
--- a/libc/src/unistd/fork.h
+++ b/libc/src/unistd/fork.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_FORK_H
 #define LLVM_LIBC_SRC_UNISTD_FORK_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/pid_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/ftruncate.h b/libc/src/unistd/ftruncate.h
index 5508ef0718e942..6d207c57805ce1 100644
--- a/libc/src/unistd/ftruncate.h
+++ b/libc/src/unistd/ftruncate.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_FTRUNCATE_H
 #define LLVM_LIBC_SRC_UNISTD_FTRUNCATE_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/off_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/getcwd.h b/libc/src/unistd/getcwd.h
index ab7038e453276c..c9ce1eb3f36f88 100644
--- a/libc/src/unistd/getcwd.h
+++ b/libc/src/unistd/getcwd.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_GETCWD_H
 #define LLVM_LIBC_SRC_UNISTD_GETCWD_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/size_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/geteuid.h b/libc/src/unistd/geteuid.h
index f19cbaefd5792a..9b602caba93042 100644
--- a/libc/src/unistd/geteuid.h
+++ b/libc/src/unistd/geteuid.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_GETEUID_H
 #define LLVM_LIBC_SRC_UNISTD_GETEUID_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/uid_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/getopt.h b/libc/src/unistd/getopt.h
index ae27958756f44a..32f4f54095c722 100644
--- a/libc/src/unistd/getopt.h
+++ b/libc/src/unistd/getopt.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_GETOPT_H
 #define LLVM_LIBC_SRC_UNISTD_GETOPT_H
 
-#include <stdio.h>
-#include <unistd.h>
+#include "include/llvm-libc-types/FILE.h"
+#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/getpid.h b/libc/src/unistd/getpid.h
index 5890dbf63681a9..09c7af247b9a42 100644
--- a/libc/src/unistd/getpid.h
+++ b/libc/src/unistd/getpid.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_GETPID_H
 #define LLVM_LIBC_SRC_UNISTD_GETPID_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/pid_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/getppid.h b/libc/src/unistd/getppid.h
index a09c7ca2241872..0db76ae34a7baa 100644
--- a/libc/src/unistd/getppid.h
+++ b/libc/src/unistd/getppid.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_GETPPID_H
 #define LLVM_LIBC_SRC_UNISTD_GETPPID_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/pid_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/getuid.h b/libc/src/unistd/getuid.h
index 35163783518c7d..7d042d2d6420d0 100644
--- a/libc/src/unistd/getuid.h
+++ b/libc/src/unistd/getuid.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_GETUID_H
 #define LLVM_LIBC_SRC_UNISTD_GETUID_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/uid_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/isatty.h b/libc/src/unistd/isatty.h
index 90a169730fe042..361cbeae433857 100644
--- a/libc/src/unistd/isatty.h
+++ b/libc/src/unistd/isatty.h
@@ -9,8 +9,6 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_ISATTY_H
 #define LLVM_LIBC_SRC_UNISTD_ISATTY_H
 
-#include <unistd.h>
-
 namespace LIBC_NAMESPACE {
 
 int isatty(int fd);
diff --git a/libc/src/unistd/link.h b/libc/src/unistd/link.h
index a95111f3a7f969..1485a62760eb3c 100644
--- a/libc/src/unistd/link.h
+++ b/libc/src/unistd/link.h
@@ -9,8 +9,6 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_LINK_H
 #define LLVM_LIBC_SRC_UNISTD_LINK_H
 
-#include <unistd.h>
-
 namespace LIBC_NAMESPACE {
 
 int link(const char *, const char *);
diff --git a/libc/src/unistd/linux/ftruncate.cpp b/libc/src/unistd/linux/ftruncate.cpp
index 795bb98ceae0cc..25175825cc6c71 100644
--- a/libc/src/unistd/linux/ftruncate.cpp
+++ b/libc/src/unistd/linux/ftruncate.cpp
@@ -8,13 +8,13 @@
 
 #include "src/unistd/ftruncate.h"
 
+#include "include/llvm-libc-types/off_t.h"
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
-
 #include "src/errno/libc_errno.h"
+
 #include <stdint.h>      // For uint64_t.
 #include <sys/syscall.h> // For syscall numbers.
-#include <unistd.h>
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/linux/lseek.cpp b/libc/src/unistd/linux/lseek.cpp
index 6f3d9937db245e..30ff1f38b0dbeb 100644
--- a/libc/src/unistd/linux/lseek.cpp
+++ b/libc/src/unistd/linux/lseek.cpp
@@ -7,14 +7,14 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/unistd/lseek.h"
-#include "src/errno/libc_errno.h"
 
+#include "include/llvm-libc-types/off_t.h"
 #include "src/__support/File/linux/lseekImpl.h"
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
+#include "src/errno/libc_errno.h"
 
 #include <sys/syscall.h> // For syscall numbers.
-#include <unistd.h>      // For off_t.
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/linux/readlink.cpp b/libc/src/unistd/linux/readlink.cpp
index 8dee58c8f215f3..ee82b81f1a5280 100644
--- a/libc/src/unistd/linux/readlink.cpp
+++ b/libc/src/unistd/linux/readlink.cpp
@@ -8,10 +8,12 @@
 
 #include "src/unistd/readlink.h"
 
+#include "include/llvm-libc-types/size_t.h"
+#include "include/llvm-libc-types/ssize_t.h"
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
-
 #include "src/errno/libc_errno.h"
+
 #include <fcntl.h>
 #include <sys/syscall.h> // For syscall numbers.
 
diff --git a/libc/src/unistd/linux/readlinkat.cpp b/libc/src/unistd/linux/readlinkat.cpp
index 479735d4f4d3d3..937eb4d5142e36 100644
--- a/libc/src/unistd/linux/readlinkat.cpp
+++ b/libc/src/unistd/linux/readlinkat.cpp
@@ -8,10 +8,12 @@
 
 #include "src/unistd/readlinkat.h"
 
+#include "include/llvm-libc-types/size_t.h"
+#include "include/llvm-libc-types/ssize_t.h"
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
-
 #include "src/errno/libc_errno.h"
+
 #include <fcntl.h>
 #include <sys/syscall.h> // For syscall numbers.
 
diff --git a/libc/src/unistd/linux/sysconf.cpp b/libc/src/unistd/linux/sysconf.cpp
index d4577c8d3d7690..7c0149975403f9 100644
--- a/libc/src/unistd/linux/sysconf.cpp
+++ b/libc/src/unistd/linux/sysconf.cpp
@@ -8,12 +8,11 @@
 
 #include "src/unistd/sysconf.h"
 
+#include "include/llvm-libc-macros/linux/unistd-macros.h"
 #include "src/__support/common.h"
-
 #include "src/errno/libc_errno.h"
 #include "src/sys/auxv/getauxval.h"
 #include <sys/auxv.h>
-#include <unistd.h>
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/linux/truncate.cpp b/libc/src/unistd/linux/truncate.cpp
index 0120cc738a9216..63cee9e6d86715 100644
--- a/libc/src/unistd/linux/truncate.cpp
+++ b/libc/src/unistd/linux/truncate.cpp
@@ -8,13 +8,13 @@
 
 #include "src/unistd/truncate.h"
 
+#include "include/llvm-libc-types/off_t.h"
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
 #include "src/errno/libc_errno.h"
 
 #include <stdint.h>      // For uint64_t.
 #include <sys/syscall.h> // For syscall numbers.
-#include <unistd.h>
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/lseek.h b/libc/src/unistd/lseek.h
index 75e33d8a6987d1..7130418b47528a 100644
--- a/libc/src/unistd/lseek.h
+++ b/libc/src/unistd/lseek.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_LSEEK_H
 #define LLVM_LIBC_SRC_UNISTD_LSEEK_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/off_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/pread.h b/libc/src/unistd/pread.h
index 6ecfef4c82c602..ec932e1f6fe8e9 100644
--- a/libc/src/unistd/pread.h
+++ b/libc/src/unistd/pread.h
@@ -9,7 +9,9 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_PREAD_H
 #define LLVM_LIBC_SRC_UNISTD_PREAD_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/off_t.h"
+#include "include/llvm-libc-types/size_t.h"
+#include "include/llvm-libc-types/ssize_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/pwrite.h b/libc/src/unistd/pwrite.h
index 535c9217c23531..98d57e4e59de36 100644
--- a/libc/src/unistd/pwrite.h
+++ b/libc/src/unistd/pwrite.h
@@ -9,7 +9,9 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_PWRITE_H
 #define LLVM_LIBC_SRC_UNISTD_PWRITE_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/off_t.h"
+#include "include/llvm-libc-types/size_t.h"
+#include "include/llvm-libc-types/ssize_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/read.h b/libc/src/unistd/read.h
index 05a56a2fdeaebb..76ac2ff28879e3 100644
--- a/libc/src/unistd/read.h
+++ b/libc/src/unistd/read.h
@@ -9,7 +9,8 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_READ_H
 #define LLVM_LIBC_SRC_UNISTD_READ_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/size_t.h"
+#include "include/llvm-libc-types/ssize_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/readlink.h b/libc/src/unistd/readlink.h
index c93c430988c79c..908f84332b45f9 100644
--- a/libc/src/unistd/readlink.h
+++ b/libc/src/unistd/readlink.h
@@ -9,7 +9,8 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_READLINK_H
 #define LLVM_LIBC_SRC_UNISTD_READLINK_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/size_t.h"
+#include "include/llvm-libc-types/ssize_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/readlinkat.h b/libc/src/unistd/readlinkat.h
index a4357efec1a1b1..2ee97b5d29930a 100644
--- a/libc/src/unistd/readlinkat.h
+++ b/libc/src/unistd/readlinkat.h
@@ -9,7 +9,8 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_READLINKAT_H
 #define LLVM_LIBC_SRC_UNISTD_READLINKAT_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/size_t.h"
+#include "include/llvm-libc-types/ssize_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/swab.h b/libc/src/unistd/swab.h
index 0a6aa49540b5b7..9fa32d669960a3 100644
--- a/libc/src/unistd/swab.h
+++ b/libc/src/unistd/swab.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_SWAB_H
 #define LLVM_LIBC_SRC_UNISTD_SWAB_H
 
-#include <unistd.h> // For ssize_t
+#include "include/llvm-libc-types/ssize_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/symlink.h b/libc/src/unistd/symlink.h
index 0a0124ccbc7ab7..ac021498bafaff 100644
--- a/libc/src/unistd/symlink.h
+++ b/libc/src/unistd/symlink.h
@@ -9,8 +9,6 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_SYMLINK_H
 #define LLVM_LIBC_SRC_UNISTD_SYMLINK_H
 
-#include <unistd.h>
-
 namespace LIBC_NAMESPACE {
 
 int symlink(const char *, const char *);
diff --git a/libc/src/unistd/symlinkat.h b/libc/src/unistd/symlinkat.h
index ecca4380e98eb1..dd83a9cc6fe5a3 100644
--- a/libc/src/unistd/symlinkat.h
+++ b/libc/src/unistd/symlinkat.h
@@ -9,8 +9,6 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_SYMLINKAT_H
 #define LLVM_LIBC_SRC_UNISTD_SYMLINKAT_H
 
-#include <unistd.h>
-
 namespace LIBC_NAMESPACE {
 
 int symlinkat(const char *, int, const char *);
diff --git a/libc/src/unistd/syscall.h b/libc/src/unistd/syscall.h
index a41d9778e05590..85b874ed12ebe6 100644
--- a/libc/src/unistd/syscall.h
+++ b/libc/src/unistd/syscall.h
@@ -9,9 +9,6 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_SYSCALL_H
 #define LLVM_LIBC_SRC_UNISTD_SYSCALL_H
 
-#include <stdarg.h>
-#include <unistd.h>
-
 namespace LIBC_NAMESPACE {
 
 long __llvm_libc_syscall(long number, long arg1, long arg2, long arg3,
diff --git a/libc/src/unistd/sysconf.h b/libc/src/unistd/sysconf.h
index 89c5efa5746364..fd9eb43ee55dbe 100644
--- a/libc/src/unistd/sysconf.h
+++ b/libc/src/unistd/sysconf.h
@@ -9,8 +9,6 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_SYSCONF_H
 #define LLVM_LIBC_SRC_UNISTD_SYSCONF_H
 
-#include <unistd.h>
-
 namespace LIBC_NAMESPACE {
 
 long sysconf(int name);
diff --git a/libc/src/unistd/truncate.h b/libc/src/unistd/truncate.h
index 5245b6bf2ed028..37932fa4fd7493 100644
--- a/libc/src/unistd/truncate.h
+++ b/libc/src/unistd/truncate.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_TRUNCATE_H
 #define LLVM_LIBC_SRC_UNISTD_TRUNCATE_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/off_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/unistd/write.h b/libc/src/unistd/write.h
index 52cdff348085f5..5d5a4435c29915 100644
--- a/libc/src/unistd/write.h
+++ b/libc/src/unistd/write.h
@@ -9,7 +9,8 @@
 #ifndef LLVM_LIBC_SRC_UNISTD_WRITE_H
 #define LLVM_LIBC_SRC_UNISTD_WRITE_H
 
-#include <unistd.h>
+#include "include/llvm-libc-types/size_t.h"
+#include "include/llvm-libc-types/ssize_t.h"
 
 namespace LIBC_NAMESPACE {
 

>From 6287ab5956ed019a80f81d3d6a0ba2d07abd2062 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 20 Mar 2024 10:25:06 -0700
Subject: [PATCH 2/3] missed one

$ grep -rn "#include <unistd" libc/src/
---
 libc/src/__support/File/linux/lseekImpl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/__support/File/linux/lseekImpl.h b/libc/src/__support/File/linux/lseekImpl.h
index d1632b703d3bc3..b4bf91263a84c9 100644
--- a/libc/src/__support/File/linux/lseekImpl.h
+++ b/libc/src/__support/File/linux/lseekImpl.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_FILE_LINUX_LSEEKIMPL_H
 #define LLVM_LIBC_SRC___SUPPORT_FILE_LINUX_LSEEKIMPL_H
 
+#include "include/llvm-libc-types/off_t.h"
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
 #include "src/__support/error_or.h"
@@ -16,7 +17,6 @@
 
 #include <stdint.h>      // For uint64_t.
 #include <sys/syscall.h> // For syscall numbers.
-#include <unistd.h>      // For off_t.
 
 namespace LIBC_NAMESPACE {
 namespace internal {

>From 7c047147aeabab54a6ab4325602dd82023a61dd2 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 20 Mar 2024 10:28:52 -0700
Subject: [PATCH 3/3] remove unnecessary include

---
 libc/src/unistd/getopt.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libc/src/unistd/getopt.h b/libc/src/unistd/getopt.h
index 32f4f54095c722..d298f392dd0f41 100644
--- a/libc/src/unistd/getopt.h
+++ b/libc/src/unistd/getopt.h
@@ -10,7 +10,6 @@
 #define LLVM_LIBC_SRC_UNISTD_GETOPT_H
 
 #include "include/llvm-libc-types/FILE.h"
-#include "src/__support/common.h"
 
 namespace LIBC_NAMESPACE {
 



More information about the libc-commits mailing list