SyntaxFix
Write A Post
Hire A Developer
Questions
Have you tried disabling buffering?
setvbuf(fd, NULL, _IONBF, 0);