Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!newspump.sol.net!www.nntp.primenet.com!nntp.primenet.com!arclight.uoregon.edu!news.uoregon.edu!news.rediris.es!acebo.sdi.uam.es!newsmasters From: txomsy@bossa-nova.cnb.uam.es (Jose R. Valverde) Newsgroups: comp.unix.bsd.misc Subject: Re: Programming Ques. - Fork and Wait Date: 8 Oct 1996 16:59:01 GMT Organization: EMBnet/CNB Lines: 30 Message-ID: <53e18l$m2s@acebo.sdi.uam.es> References: <532p4u$al0@cssun.cs.usm.my> <5357bg$lff@cssun.cs.usm.my> <53aijp$3ko@innocence.interface-business.de> NNTP-Posting-Host: bossa-nova.cnb.uam.es Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Newsreader: knews 0.9.8 In article <53aijp$3ko@innocence.interface-business.de>, j@ida.interface-business.de (J Wunsch) writes: > cyfok@network4.cs.usm.my (Chee-Youn Fok) wrote: > >> Sorry for my previous posting which didn't come with the question. >> ACtually I would like to ask whether is it possible to implement the >> algorithm ? Since what I heard is that we can't pass value to the child >> process which is created by the parent process. > > Of course, you can pass a value down to the child. If you've got the > value ready before fork()ing, the child will (of course) inherit it. > Otherwise, you gotta use one of the various IPC methods. For BSD-like ..... > > Passing up a value from the child to its parent, however, always > requires IPC. > Pardon? For the kind of problem proposed there may be other possibilities. If you know the value, you can pass it as an argument to a child process called with exec after the fork(). You can get an integer result from a child just looking at its status code. In this case this might do the trick without IPC. jr