Open michaelrj-google opened 5 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: Michael Jones (michaelrj-google)
@llvm/issue-subscribers-libc
Author: Michael Jones (michaelrj-google)
Interested
I did mean to put it in linux.td
since it's specifically a linux function and not in posix. If there isn't a unistd.h
HeaderSpec
in linux.td
yet then you'll have to create a new one and add it to the list of headers at the bottom.
@michaelrj-google Should this HeaderSpec
in linux.td contain FunctionSpec
s for every syscall in libc/src/unistd/ or just for pipe2?
just pipe2
is fine for the moment
@michaelrj-google I am unable to generate the test file for pipe2_test.cpp. I have tried:
$ cmake ../llvm -G Ninja -DLLVM_ENABLE_PROJECTS="libc" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
$ ninja libc_unistd_unittests
but the output does not show a test for pipe2.
Please take a look at my patch 85514.
The pipe2 is defined on linux here: https://man7.org/linux/man-pages/man2/pipe.2.html
This is a simple syscall wrapper, so implementation should be straightforward.
Build System
In entrypoints.txt
In unistd/CMakeLists.txt
In linux.td
Code
Create
unistd/pipe2.h
Create
unistd/linux/pipe2.cpp
Testing
Create
test/src/unistd/pipe2_test.cpp
Add your tests to test/src/unistd/CMakeLists.txt