-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributelibc
Description
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
- Add the new function to the list of entrypoints for unistd.h (you need to do this before it will build)
- Add new entrypoint objects to the list
- Also add it to the list for unistd/linux/CMakeLists.txt
In linux.td
- Add the functions to the list of functions for unistd.h (this can be confusing, ask for help if you're stuck).
Code
Create unistd/pipe2.h
- look at dup.h for an example of how this should be laid out (copying the whole file and modifying it is fine).
Create unistd/linux/pipe2.cpp
- Again, look at look at linux/dup.cpp for an example.
Testing
Create test/src/unistd/pipe2_test.cpp
- This needs to test the function succeeding and failing
- This is only testing the code you wrote, so don't worry too much about testing parts of the interface that the kernel handles.
Add your tests to test/src/unistd/CMakeLists.txt
- Hopefully self-explanatory
Metadata
Metadata
Assignees
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributelibc