Skip to content

[libc] Fix ioctl errno inclusion #143928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

michaelrj-google
Copy link
Contributor

Since errno was moved in
#143187 the code including it
in #141393 was rendered
incorrect. This patch fixes the include and the cmake depends.

Since errno was moved in
llvm#143187 the code including it
in llvm#141393 was rendered
incorrect. This patch fixes the include and the cmake depends.
@llvmbot
Copy link
Member

llvmbot commented Jun 12, 2025

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

Changes

Since errno was moved in
#143187 the code including it
in #141393 was rendered
incorrect. This patch fixes the include and the cmake depends.


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

3 Files Affected:

  • (modified) libc/src/sys/ioctl/linux/ioctl.cpp (+1-1)
  • (modified) libc/test/src/sys/ioctl/linux/CMakeLists.txt (+2-1)
  • (modified) libc/test/src/sys/ioctl/linux/ioctl_test.cpp (+1-1)
diff --git a/libc/src/sys/ioctl/linux/ioctl.cpp b/libc/src/sys/ioctl/linux/ioctl.cpp
index f03fea21c75bd..9bb669c6a6f66 100644
--- a/libc/src/sys/ioctl/linux/ioctl.cpp
+++ b/libc/src/sys/ioctl/linux/ioctl.cpp
@@ -10,7 +10,7 @@
 
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
-#include "src/errno/libc_errno.h"
+#include "src/__support/libc_errno.h"
 #include <stdarg.h>
 #include <sys/syscall.h> // For syscall numbers.
 
diff --git a/libc/test/src/sys/ioctl/linux/CMakeLists.txt b/libc/test/src/sys/ioctl/linux/CMakeLists.txt
index e5095c54a729f..2df67e9d9cbde 100644
--- a/libc/test/src/sys/ioctl/linux/CMakeLists.txt
+++ b/libc/test/src/sys/ioctl/linux/CMakeLists.txt
@@ -7,7 +7,7 @@ add_libc_unittest(
   SRCS
     ioctl_test.cpp
   DEPENDS
-    libc.hdr.ioctl_macros
+    libc.hdr.sys_ioctl_macros
     libc.src.sys.ioctl.ioctl
     libc.src.errno.errno
     libc.src.fcntl.open
@@ -15,3 +15,4 @@ add_libc_unittest(
     libc.src.unistd.read
     libc.src.unistd.write
 )
+
diff --git a/libc/test/src/sys/ioctl/linux/ioctl_test.cpp b/libc/test/src/sys/ioctl/linux/ioctl_test.cpp
index 9c56a4689b186..b76dc14824c95 100644
--- a/libc/test/src/sys/ioctl/linux/ioctl_test.cpp
+++ b/libc/test/src/sys/ioctl/linux/ioctl_test.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/errno/libc_errno.h"
+#include "src/__support/libc_errno.h"
 #include "src/fcntl/open.h"
 #include "src/sys/ioctl/ioctl.h"
 #include "src/unistd/close.h"

@michaelrj-google michaelrj-google merged commit ae7ea6e into llvm:main Jun 12, 2025
15 checks passed
@michaelrj-google michaelrj-google deleted the libcIoctlFix branch June 12, 2025 16:38
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
Since errno was moved in
llvm#143187 the code including it
in llvm#141393 was rendered
incorrect. This patch fixes the include and the cmake depends.
akuhlens pushed a commit to akuhlens/llvm-project that referenced this pull request Jun 24, 2025
Since errno was moved in
llvm#143187 the code including it
in llvm#141393 was rendered
incorrect. This patch fixes the include and the cmake depends.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants