[all-commits] [llvm/llvm-project] 759191: Recommit "[libc] Introduce the ioctl syscall wrapp...

Pavel Labath via All-commits all-commits at lists.llvm.org
Tue Jun 23 09:33:50 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 759191045115d966dffc99901e9086289767ff5c
      https://github.com/llvm/llvm-project/commit/759191045115d966dffc99901e9086289767ff5c
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2026-06-23 (Tue, 23 Jun 2026)

  Changed paths:
    M libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
    A libc/src/__support/OSUtil/linux/syscall_wrappers/ioctl.h
    M libc/src/sys/ioctl/linux/CMakeLists.txt
    M libc/src/sys/ioctl/linux/ioctl.cpp
    M libc/src/termios/linux/CMakeLists.txt
    M libc/src/termios/linux/tcdrain.cpp
    M libc/src/termios/linux/tcflow.cpp
    M libc/src/termios/linux/tcflush.cpp
    M libc/src/termios/linux/tcgetattr.cpp
    M libc/src/termios/linux/tcgetsid.cpp
    M libc/src/termios/linux/tcsendbreak.cpp
    M libc/src/termios/linux/tcsetattr.cpp
    M libc/src/unistd/linux/CMakeLists.txt
    M libc/src/unistd/linux/isatty.cpp

  Log Message:
  -----------
  Recommit "[libc] Introduce the ioctl syscall wrapper and port all callers (#204640)" (#205317)

This patch reapplies #204640 (reverted in #205277), due to (-Werror)
build failure with gcc. Gcc warned about passing an uninitialized
structure through a `const void *` argument. This isn't a problem
because the ioctls in question write to that argument. The
fix/workaround is to provide a `void *` overload.

The original commit message was:

This patch adds an ioctl syscall wrapper in linux_syscalls namespace and
migrates all direct SYS_ioctl calls to use it.

To handle the polymorphic nature of ioctl arguments (where some commands
expect pointers, some expect scalar integers like queue_selector, and
some expect no argument at all), I use a helper struct IoctlArg with
implicit constructors. This avoids template bloat and overload
ambiguities (particularly around literal 0) while keeping call sites
clean.

Assisted by Gemini.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list