Things you didn't want to know about curses(3)

Poul-Henning Kamp phk at phk.freebsd.dk
Sat Jan 13 00:39:06 UTC 2018


I just spent far too much time finding out why the new terminal
support in varnishtest::process left hanging varnish{hist|stat|top}
processes on test-failure.

Remembering the follwing bit of learned wisdom may save you time
in a somewhat strange set of circumstances:

In curses(3) the wgetch(3) function both returns ERR for timeouts,
(if configured with timeout(3)), and for EOF on stdin.

In other words, EOF on stdin had better be accompanied by SIGHUP
or your cursed program will just spin if it uses timeout(3).

One would think somebody had fixed that by now...

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


More information about the varnish-dev mailing list