Page MenuHomeFreeBSD

sh: Allow vfork on redirected simple commands
Needs ReviewPublic

Authored by jilles on Sun, Feb 8, 11:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Feb 20, 2:11 AM
Unknown Object (File)
Wed, Feb 18, 1:14 PM
Unknown Object (File)
Mon, Feb 16, 1:48 AM
Unknown Object (File)
Wed, Feb 11, 5:36 PM
Unknown Object (File)
Wed, Feb 11, 5:18 PM
Unknown Object (File)
Wed, Feb 11, 4:46 AM
Unknown Object (File)
Wed, Feb 11, 4:15 AM
Unknown Object (File)
Tue, Feb 10, 11:11 AM
Subscribers

Details

Reviewers
bdrewery
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