HomeFreeBSD

script(1): work around slow reading child

Description

script(1): work around slow reading child

If child is slow reading from its input, or even completely stops doing
the read, script(1) hangs in write(2) to the pts master waiting until
there is a space in the terminal discipline buffer. This also stops
handling any outer io, as well as child output.

Work around the problem by making pts master fd non-blocking, and be
prepared for short writes to it. The data to be written to master is
buffered in the tailq which is processed when select(2) detects that
master is ready for write.

PR: 260938
Reported by: наб <nabijaczleweli@nabijaczleweli.xyz>
See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003095
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33789

Details

Provenance
kibAuthored on Jan 8 2022, 1:19 PM
Reviewer
markj
Differential Revision
D33789: script(1): work around slow reading child
Parents
rGba94a95402f3: gpart(8): add minimal reference to glabel(8) to manual page
Branches
Unknown
Tags
Unknown