freebsd-dev/usr.bin/script
Konstantin Belousov c0ba4c2ee2 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
2022-01-10 17:34:51 +02:00
..
Makefile
Makefile.depend
script.1 Add some examples to script.1 2021-01-05 16:32:27 +01:00
script.c script(1): work around slow reading child 2022-01-10 17:34:51 +02:00