home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!charnel!sifon!onsager.chem.mcgill.ca!ronis
- From: ronis@onsager.chem.mcgill.ca (David Ronis)
- Newsgroups: comp.os.msdos.desqview
- Subject: fork() & pipe() in DVX
- Message-ID: <1992Dec29.183140.15774@sifon.cc.mcgill.ca>
- Date: 29 Dec 92 18:31:40 GMT
- Sender: news@sifon.cc.mcgill.ca
- Organization: McGill University
- Lines: 23
- Nntp-Posting-Host: onsager.chem.mcgill.ca
- X-Newsreader: Tin 1.1 PL5
-
- I'm currently porting ghostview to DV/X using djgpp and the X support released in
- qdvx101.zip. I get a clean compile, but end up with problems at link. Specifically,
- popen() and pclose() are missing. Fortunately, all these are used for is to send stuff
- to the printer, which I'm not too concerned about, and which I can easily fake.
-
- When I try to run the program, however, things work well until it tries to spawn a subprocess.
- Specifically, the program makes some pipes and then forks() [pipe() and fork() are just stubs
- in djgpp 1.09], the child then sets stdin and stdout to the fd's of the opened pipes, and
- exec's ghostscript to process the file. If fork() worked, I would get into trouble since,
- exec doesn't.
-
- My question is this: can I fake fork() using the routines in dvapi? Clearly I can spawn a
- subprocess, but how do I get the subprocess to inherit my file descriptors? Does this happen
- automatically?
-
- Finally, at some point the parent program want's to kill the child. It does this using kill()
- followed by wait(); here, too all I have are stubs. There doesn't seem to be anything in the
- dvapi routines in qdvx101 that allows me to kill the child, although the documentation says
- that NewProc returns the handle of the opened process, shouldn't I be able to kill the child?
-
- Thanks in advance,
-
- David Ronis
-