#include #include "newcalls.h" int main() { int fds[2]; _pipe(fds); printf("opened pipe / in fd=%d,out fd=%d\n",fds[0],fds[1]); int pid=_fork(); if(pid) { while(1) // read forever from our pipe and echo to stdout { char buf[256]; int len=fread(buf,1,255,fds[0]); printf("%s",buf); } } else { // write to our pipe fwrite("Hello\n",1,6,fds[1]); fwrite("Bello\n",1,6,fds[1]); fwrite("Gello\n",1,6,fds[1]); // hang forever while(1); } }