- #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");
-
exit(0);
-
}
print the stdin to stdout
PS:
STDOUT_FILENO---------------->1
STDIN_FILENO----------------->0
STDERR_FILENO----------------->2
阅读(869) | 评论(0) | 转发(0) |