Details
- Reviewers
michaelrj thesamesam
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/stdio/fileno.cpp | ||
---|---|---|
3 | nit: line formatting |
libc/config/linux/x86_64/entrypoints.txt | ||
---|---|---|
430 | Can we add this to the other configs also? | |
libc/src/stdio/fileno.cpp | ||
19 | This is not a fully evolved API yet. For example, the Linux implementation does not try to check if stream is actually a file stream. But, we have not yet decided if the get_fileno should be responsible to perform that check, or if it is the job of this function to perform that check. It feels like we should have some kind of flag maintained in the File data structure to indicate whether stream has a number or not. Let me think about this and get back. If you have any better suggestions to make, feel free to share. |
@sivachandra: Yes, I also wondered about that (re: "Linux implementation does not try to check if stream is actually a file stream"). I don't know what the best solution is. I tried both glibc and llvm-libc with invalid stream as argument and both crashed. Seems like musl libc also just assumes that the file ptr is valid https://elixir.bootlin.com/musl/latest/source/src/stdio/fileno.c#L7
libc/config/linux/x86_64/entrypoints.txt | ||
---|---|---|
430 | do you mean in config/linux/*every arch that works*/entrypoints.txt ? The get_fileno function is currently only implemented for Linux. |
Can we add this to the other configs also?