Skip to content

Instantly share code, notes, and snippets.

@ecylmz
Created September 25, 2011 09:39
Show Gist options
  • Save ecylmz/1240425 to your computer and use it in GitHub Desktop.
Save ecylmz/1240425 to your computer and use it in GitHub Desktop.
hmm [c sistem-programlama]
#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