glibc gets this right too
#include <stdio.h>
int main(int argc, char *argv[])
{
close(1);
if(printf("Hello")==-1)
perror("printf");
if(fflush(stdout)==-1)
perror("fflush");
}
% ./doh
fflush: Bad file descriptor
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html