[FS] Make fstat work on file descriptors with no name in memfs#23470
[FS] Make fstat work on file descriptors with no name in memfs#23470hoodmane merged 8 commits intoemscripten-core:mainfrom
Conversation
This makes fstat work on anonymous memfs file descriptors. It is split off from emscripten-core#23058.
|
So code size went down by a little. But now |
|
Well it's always possible to directly copy the ci output. Maybe check_expectations could print something like the following when it fails so I could paste it into the terminal and apply the updates that CI wanted: |
I'm hoping to have the CI automatically add make those change perhaps? In order to get the same results as the CI you need to make sure you do |
I think I have been doing that, but it seems to work only some of the time... |
Oh, there is also the case when This happens when llvm of binaryen changes effect code sizes. In that case I normally push a specific update commit, which I can look into doing now. |
|
Indeed if you looks at the failing CI test its called I updated main in 12ca58d |
|
Okay I rearranged the code in attempt to address your comments. Does it look better? |
| ftruncate(fd, len) { | ||
| var stream = FS.getStreamChecked(fd); | ||
| if ((stream.flags & {{{ cDefs.O_ACCMODE }}}) === {{{ cDefs.O_RDONLY}}}) { | ||
| if (len < 0 || (stream.flags & {{{ cDefs.O_ACCMODE }}}) === {{{ cDefs.O_RDONLY}}}) { |
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (18) test expectation files were updated by running the tests with `--rebaseline`: ``` other/codesize/test_codesize_cxx_ctors1.gzsize: 8343 => 8359 [+16 bytes / +0.19%] other/codesize/test_codesize_cxx_ctors1.jssize: 20273 => 20296 [+23 bytes / +0.11%] other/codesize/test_codesize_cxx_ctors2.gzsize: 8327 => 8341 [+14 bytes / +0.17%] other/codesize/test_codesize_cxx_ctors2.jssize: 20241 => 20264 [+23 bytes / +0.11%] other/codesize/test_codesize_cxx_except.gzsize: 9343 => 9358 [+15 bytes / +0.16%] other/codesize/test_codesize_cxx_except.jssize: 24041 => 24064 [+23 bytes / +0.10%] other/codesize/test_codesize_cxx_except_wasm.gzsize: 8294 => 8303 [+9 bytes / +0.11%] other/codesize/test_codesize_cxx_except_wasm.jssize: 20166 => 20189 [+23 bytes / +0.11%] other/codesize/test_codesize_cxx_except_wasm_legacy.gzsize: 8294 => 8303 [+9 bytes / +0.11%] other/codesize/test_codesize_cxx_except_wasm_legacy.jssize: 20166 => 20189 [+23 bytes / +0.11%] other/codesize/test_codesize_cxx_lto.gzsize: 8357 => 8372 [+15 bytes / +0.18%] other/codesize/test_codesize_cxx_lto.jssize: 20348 => 20371 [+23 bytes / +0.11%] other/codesize/test_codesize_cxx_mangle.gzsize: 9349 => 9364 [+15 bytes / +0.16%] other/codesize/test_codesize_cxx_mangle.jssize: 24041 => 24064 [+23 bytes / +0.10%] other/codesize/test_codesize_cxx_noexcept.gzsize: 8343 => 8359 [+16 bytes / +0.19%] other/codesize/test_codesize_cxx_noexcept.jssize: 20273 => 20296 [+23 bytes / +0.11%] other/codesize/test_codesize_files_js_fs.gzsize: 7647 => 7669 [+22 bytes / +0.29%] other/codesize/test_codesize_files_js_fs.jssize: 18820 => 18843 [+23 bytes / +0.12%] Average change: +0.14% (+0.10% - +0.29%) ```
This makes fstat work on anonymous memfs file descriptors. It is split off from #23058.