-
-
Save ecylmz/1240425 to your computer and use it in GitHub Desktop.
hmm [c sistem-programlama]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "apue.h" | |
#define BUFFSIZE 4096 | |
int main(void) { | |
int n; | |
char buf[BUFFSIZE]; | |
while ((n = read(STDIN_FILENO, buf, BUFFSIZE)) > 0) | |
if (write(STDOUT_FILENO, buf, n) != n) | |
err_sys("write error"); | |
if (n < 0) | |
err_sys("read error"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment