emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.91k stars 3.32k forks source link

Make fstat work on file descriptor with no name #23058

Open hoodmane opened 16 hours ago

hoodmane commented 16 hours ago

This also is a bit more efficient: rather than taking the stream and converting it to a path, then calling lookupPath to find the node and calling getattr on it, just lookup stream.node and call getattr on it directly.

hoodmane commented 15 hours ago

Looks like to fix this in NODEFS, we need to make stream_ops.getattr and stream_ops.setattr and have fstat, fchmod, fchown, and ftruncate use them instead of the corresponding node_ops if they exist.