[syscall] Accept O_NONBLOCK flag in pipe2#26501
[syscall] Accept O_NONBLOCK flag in pipe2#26501thiblahute wants to merge 2 commits intoemscripten-core:mainfrom
Conversation
sbc100
left a comment
There was a problem hiding this comment.
Can you update the test for pipe2 to include this flag?
sbc100
left a comment
There was a problem hiding this comment.
lgtm otherwise! Thanks for working on this
|
Added a test |
ae16cf7 to
b91ca8d
Compare
Head branch was pushed to by a user without write access
b91ca8d to
2183911
Compare
|
For the codesize test updates you will want to do |
pipe2 only accepted O_CLOEXEC, rejecting O_NONBLOCK with ENOTSUP. Accept O_NONBLOCK and set it on the created pipe streams. This is needed by GLib's GWakeup which uses pipe2(fds, O_CLOEXEC | O_NONBLOCK).
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (31) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_cxx_ctors1.json: 151832 => 151832 [+0 bytes / +0.00%] codesize/test_codesize_cxx_ctors2.json: 151235 => 151235 [+0 bytes / +0.00%] codesize/test_codesize_cxx_except.json: 195690 => 195690 [+0 bytes / +0.00%] codesize/test_codesize_cxx_except_wasm.json: 166948 => 166948 [+0 bytes / +0.00%] codesize/test_codesize_cxx_except_wasm_legacy.json: 164829 => 164829 [+0 bytes / +0.00%] codesize/test_codesize_cxx_lto.json: 120519 => 120519 [+0 bytes / +0.00%] codesize/test_codesize_cxx_mangle.json: 262181 => 262181 [+0 bytes / +0.00%] codesize/test_codesize_cxx_noexcept.json: 153855 => 153855 [+0 bytes / +0.00%] codesize/test_codesize_cxx_wasmfs.json: 179737 => 179737 [+0 bytes / +0.00%] codesize/test_codesize_file_preload.json: 23789 => 23789 [+0 bytes / +0.00%] codesize/test_codesize_files_js_fs.json: 18215 => 18215 [+0 bytes / +0.00%] codesize/test_codesize_files_wasmfs.json: 63883 => 63883 [+0 bytes / +0.00%] codesize/test_codesize_hello_O0.json: 39111 => 39111 [+0 bytes / +0.00%] codesize/test_codesize_hello_O1.json: 8875 => 8875 [+0 bytes / +0.00%] codesize/test_codesize_hello_dylink.json: 43853 => 43853 [+0 bytes / +0.00%] codesize/test_codesize_hello_dylink_all.json: 821751 => 821794 [+43 bytes / +0.01%] codesize/test_codesize_mem_O3.json: 9614 => 9614 [+0 bytes / +0.00%] codesize/test_codesize_mem_O3_grow.json: 9900 => 9900 [+0 bytes / +0.00%] codesize/test_codesize_minimal_O0.json: 20467 => 20467 [+0 bytes / +0.00%] codesize/test_codesize_minimal_pthreads.json: 26409 => 26409 [+0 bytes / +0.00%] codesize/test_codesize_minimal_pthreads_memgrowth.json: 26812 => 26812 [+0 bytes / +0.00%] codesize/test_minimal_runtime_code_size_hello_embind.json: 14909 => 14909 [+0 bytes / +0.00%] codesize/test_minimal_runtime_code_size_hello_embind_val.json: 11642 => 11642 [+0 bytes / +0.00%] codesize/test_minimal_runtime_code_size_hello_webgl2_wasm.json: 13200 => 13200 [+0 bytes / +0.00%] codesize/test_minimal_runtime_code_size_hello_webgl2_wasm2js.json: 18534 => 18534 [+0 bytes / +0.00%] codesize/test_minimal_runtime_code_size_hello_webgl2_wasm_singlefile.json: 15046 => 15046 [+0 bytes / +0.00%] codesize/test_minimal_runtime_code_size_hello_webgl_wasm.json: 12738 => 12738 [+0 bytes / +0.00%] codesize/test_minimal_runtime_code_size_hello_webgl_wasm2js.json: 18060 => 18060 [+0 bytes / +0.00%] codesize/test_minimal_runtime_code_size_random_printf_wasm.json: 10815 => 10815 [+0 bytes / +0.00%] codesize/test_minimal_runtime_code_size_random_printf_wasm2js.json: 17114 => 17114 [+0 bytes / +0.00%] codesize/test_unoptimized_code_size.json: 180230 => 180230 [+0 bytes / +0.00%] Average change: +0.00% (+0.00% - +0.01%) ```
2183911 to
e25ce23
Compare
|
From https://github.com/emscripten-core/emscripten/actions/runs/23765785637/job/69244759709?pr=26501: This looks weird to me |
Hmm.. yes that does looks strange. That can happen sometimes when the script doesn't know how to parse the json file in question correctly. Are you able to run If you are not able to do that, and you have tried |
pipe2 only accepted O_CLOEXEC, rejecting O_NONBLOCK with ENOTSUP. Accept O_NONBLOCK and set it on the created pipe streams, it is a no-op in practice, but there is no reason to not allow it.