Here a sample code: #include <stdio.h> int main() { char input[80]; while (fgets(input, 80, stdin) != NULL) { // nop } fgets(input, 80, stdin); printf("%s\n", input); return 0; } After sending EOF to exit the loop, the second fgets returns immediately return NULL, no second input possible. Compiling on 2.27 works as expected. Compiling on a 2.27 system with -static and executing on a 2.29 System also works. I have no more glibc versions to check more. Only can say bugged on 2.29, works on 2.27.
This is correct behaviour. EOF is supposed to be sticky, see commit 2cc7bad0ae.