home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / msdos / desqview / 4109 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  1.7 KB

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