Open nickdesaulniers opened 6 months ago
Hi!
This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
test/
create fine-grained testing targets, so you can e.g. use make check-clang-ast
to only run Clang's AST tests.git clang-format HEAD~1
to format your changes.If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.
@llvm/issue-subscribers-good-first-issue
Author: Nick Desaulniers (nickdesaulniers)
@llvm/issue-subscribers-libc
Author: Nick Desaulniers (nickdesaulniers)
Hi I am interested in this issue, can this be assigned to me? Thanks.
Hi @changkhothuychung , thanks for your interest!
This one will be interesting, since the ioctl
interface is variadic, but syscalls have an upper limit on how many args can be passed in registers. FWICT, it seems like va_start
, va_arg
, and va_end
can be used to unpack a void*
which is then passed as the third parameter for the syscall.
048041f197197 is probably a good example of adding a new entry that's specific to linux. I'd use that as a reference for the boilerplate that needs to be added.
Terrifyingly, POSIX seems to have standardized this interface, under a different header and with a different signature than what is used in linux. https://pubs.opengroup.org/onlinepubs/9699919799/functions/ioctl.html
I'll probably have to do some more digging into the history there, but for now, please provide an implementation based on the signature and header as specified by man 3 ioctl
.
@nickdesaulniers Thank you very much for the instructions! I will start working on it and will make a PR as soon as I have some progress.
@nickdesaulniers do you have any documentations about building and testing libc? Thanks.
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:
I assume once ioctl is implemented, all of the above open coded calls should be replaced with the call to our internal wrapper.