today happy, help help you.
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#define MAXLINE 80
void err_sys(const char *p_error);
int main(void)
{
char buf[MAXLINE];
int n;
if ((n = read(STDIN_FILENO, buf, MAXLINE)) < 0)
err_sys("read error.");
if (write(STDOUT_FILENO, buf, n) != n)
err_sys("write error.");
exit(0);
}
void err_sys(const char *p_error)
{
assert(p_error != NULL);
printf("%s\n", p_error);
exit(1);
}
you need use Linux system