Skip to content

Conversation

boomanaiden154
Copy link
Contributor

This patch adds some hdrgen yaml for ioctl(). Otherwise the function never actually ends up being available in a full build. This is the last thing that is needed to enable turning on LIBCXX_ENABLE_RANDOM_DEVICE.

This patch adds some hdrgen yaml for ioctl(). Otherwise the function
never actually ends up being available in a full build. This is the last
thing that is needed to enable turning on LIBCXX_ENABLE_RANDOM_DEVICE.
@llvmbot
Copy link
Member

llvmbot commented Aug 16, 2025

@llvm/pr-subscribers-libc

Author: Aiden Grossman (boomanaiden154)

Changes

This patch adds some hdrgen yaml for ioctl(). Otherwise the function never actually ends up being available in a full build. This is the last thing that is needed to enable turning on LIBCXX_ENABLE_RANDOM_DEVICE.


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

1 Files Affected:

  • (modified) libc/include/sys/ioctl.yaml (+7-1)
diff --git a/libc/include/sys/ioctl.yaml b/libc/include/sys/ioctl.yaml
index 5f7b7f333191e..f323cc9b431b4 100644
--- a/libc/include/sys/ioctl.yaml
+++ b/libc/include/sys/ioctl.yaml
@@ -5,4 +5,10 @@ macros: []
 types: []
 enums: []
 objects: []
-functions: []
+functions:
+  - name: ioctl
+    return_type: int
+    arguments:
+      - type: int
+      - type: unsigned long
+      - type: '...'

Copy link
Contributor

@frobtech frobtech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but we'll have to fix the standards list both to be correct and to make hdrgen work since it demands precise spellings now.

@@ -5,4 +5,10 @@ macros: []
types: []
enums: []
objects: []
functions: []
functions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix the "standards" list here while we're making this header usable. POSIX definitely does not specify ioctl or <sys/ioctl.h>. Both bsd and linux are reasonable things to list here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added Linux.

I didn't add anything originally given https://man7.org/linux/man-pages/man2/ioctl.2.html doesn't mention any standards, but it is a Linux syscall.

@boomanaiden154 boomanaiden154 merged commit 71925a9 into llvm:main Aug 17, 2025
19 checks passed
@boomanaiden154 boomanaiden154 deleted the libc-hdrgen-ioctl branch August 17, 2025 15:52
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