https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97834
Roland Illig <roland.illig at gmx dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |INVALID --- Comment #8 from Roland Illig <roland.illig at gmx dot de> --- Got it. NetBSD's stdio is broken. #include <stdio.h> int main(void) { char buf[4096]; setbuf(stdin, NULL); fread(buf, 1, 4096, stdin); return 0; } This innocent-looking program indeed calls read(2) 4096 times. Sorry for the interruption, thanks for your help.