Skip to content

[libc] implement ioctl #85275

Closed
Closed
@nickdesaulniers

Description

@nickdesaulniers

the ioctl syscall is pretty important, and is used by libc++ for LIBCXX_ENABLE_RANDOM_DEVICE support.

We currently define a few macros for ioctl in include/llvm-libc-macros/sys-ioctl-macros.h and generate ioctl.h via include/sys/ioctl.h.def.

I also see open coded calls to ioctl in:

  • src/unistd/linux/isatty.cpp
  • src/termios/linux/tcgetattr.cpp
  • src/termios/linux/tcsendbreak.cpp
  • src/termios/linux/tcgetsid.cpp
  • src/termios/linux/tcdrain.cpp
  • src/termios/linux/tcsetattr.cpp
  • src/termios/linux/tcflush.cpp
  • src/termios/linux/tcflow.cpp

I assume once ioctl is implemented, all of the above open coded calls should be replaced with the call to our internal wrapper.

Metadata

Metadata

Labels

good first issuehttps://github.com/llvm/llvm-project/contributelibc

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions