Page MenuHomeFreeBSD

sh: Allow vfork on redirected simple commands
ClosedPublic

Authored by jilles on Feb 8 2026, 11:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 17, 4:24 PM
Unknown Object (File)
Sun, May 17, 4:19 PM
Unknown Object (File)
Sun, May 17, 10:22 AM
Unknown Object (File)
Sun, May 17, 10:14 AM
Unknown Object (File)
Thu, May 14, 3:07 PM
Unknown Object (File)
Thu, May 14, 3:30 AM
Unknown Object (File)
Wed, May 13, 11:56 PM
Unknown Object (File)
Wed, May 13, 10:53 PM
Subscribers

Details

Summary

Things like { some_program; } >/dev/null use vfork, so use vfork
similarly for things like some_program >/dev/null.

This cannot be done for command substitutions, because of two problems:

  • Redirections might cause the error message for later redirections or for an unknown command to be sent to the pipe (to be substituted), and this might cause a deadlock if the message is too long.
  • The assignment of the pipe needs to come before instead of after the redirections.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70532
Build 67415: arc lint + arc unit

Event Timeline

Thank you! I ran it through poudriere's test suite with no problems.

This revision is now accepted and ready to land.Apr 22 2026, 12:58 AM
This revision was automatically updated to reflect the committed changes.