This patch implements the fopen, fclose, and fread functions on
the GPU. These are pretty much re-implemented from what existed but
using the new interface. Having this subset allows us to test the
interface a bit more strenuously since we can write and read to a file.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Linux has in-memory files that would be a good fit for testing this. Memfd. Gives you a block of allocated memory that acts like a file.
Comment Actions
That's neat, would save us the temporary file. But I think it's a little out of scope since the test already exists and this patch just uses it.
libc/src/stdio/gpu/fopen.cpp | ||
---|---|---|
25 | I should probably make this max out at the buffer size in case someone does fopen("foo.txt", /*ReallyLongString=*/str). |
I should probably make this max out at the buffer size in case someone does fopen("foo.txt", /*ReallyLongString=*/str).