commit 0cc95d65cf944b0e7b101c917b3b8af531ba4924
parent 10293ca254b2a6686334d0b51712bd88dccd20fd
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 19 Aug 2020 18:45:05 +0200
explicitly define VMIN and VTIME values for read()
VMIN represents the minimum number of bytes that should be received when the
read(2) function successfully returns.
VTIME is a timer of 0.1 second granularity that is used to time out bursty and
short term data transmissions.
This fixes a read buffering issue on OpenIndiana/Illumos and on HaikuOS where
the default reading buffer is 4-5 bytes (noticed by testing).
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/sfeed_curses.c b/sfeed_curses.c
@@ -522,6 +522,8 @@ init(void)
tcgetattr(0, &tsave);
memcpy(&tcur, &tsave, sizeof(tcur));
tcur.c_lflag &= ~(ECHO|ICANON);
+ tcur.c_cc[VMIN] = 1;
+ tcur.c_cc[VTIME] = 0;
tcsetattr(0, TCSANOW, &tcur);
resizewin();