Consider the following line of code while((n = read( STDIN_FILENO, buff, BUFSIZ)) > 0) As per my ...
stackoverflow.com