#include #include int main(int argc, char **argv) { int pfd[2], rb; char buff[100]; if (pipe(pfd)<0) { return -1; } close(pfd[1]); if (fork()) { sleep(5); write(pfd[1], "hello world\n", sizeof("hello world\n")); wait(NULL); } else { rb = read(pfd[0], buff, sizeof(buff)); if (rb < 0) perror("SON: read"); else { printf("SON: writing %d\n", rb); write(1, buff, rb); } } return 0; }