Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!umich!sharkey!cfctech!teemc!ka3ovk!ki4pv!cdin-1!dsinc!netnews.upenn.edu!cps3xx!bruey From: bruey@cpsin2.cps.msu.edu Newsgroups: comp.lang.c Subject: help on interprocess communication Message-ID: <6456@cps3xx.UUCP> Date: 14 Feb 90 18:23:51 GMT Sender: usenet@cps3xx.UUCP Reply-To: bruey@cpsin2.cps.msu.edu () Distribution: usa Organization: Dept. of Computer Science, Michigan State University Lines: 33 Can any of you brainy netlanders give me a hint why this doesn't work? I've been cursing at this code for days and I can't get it to work. (I'm not even sure that the forks are in the right order. So basically, I'm lost.) #include main() { /* yes, I know I don't need all of these declarations, but this isn't the only part of the program */ int pid; int id1,id2,id3; int rc=0,status,parent; int filedes[2]; char *a,*buf1,*buf; pipe(filedes); if (fork()) { printf("%d %d are filedes \n",filedes[0],filedes[1]); buf = "first message"; write(filedes[1],buf,14); if(fork()) { read(filedes[1],buf1,14); printf("in second %s \n",buf1); } } }