stdbuf: use exec instead of forking
forking creates a new PID and it not compatible with GNU coreutils implementation.
- use
Command::exec()instead ofCommand::spawn()which forks - add stdbuf test verifying that no forking happens
Fixes https://github.com/uutils/coreutils/issues/9066
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
The CI errors are unrelated to my branch.
The CI err is coming from https://github.com/uutils/coreutils/pull/9471
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
CodSpeed Performance Report
Merging #9495 will not alter performance
Comparing Ecordonnier:eco/stdbuf-exec-instead-of-fork (7963769) with main (2000af8)
Summary
✅ 127 untouched
⏩ 6 skipped[^skipped]
[^skipped]: 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
This is ready for review. I don't intend to work on this branch any more.
I've just seen https://github.com/uutils/coreutils/pull/9013#issuecomment-3446625332 which is also relevant for my PR. I'll check if Command::exec() can be used instead of Command::status().
GNU testsuite comparison:
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
The PR is ready for review.
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/inotify-dir-recreate is now passing!