home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / c / 13654 < prev    next >
Encoding:
Text File  |  1992-09-14  |  1.3 KB  |  38 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!rpi!sarah!cook!karp.albany.edu!ganesh
  3. From: ganesh@cs.albany.edu (Ganesh Murugesan)
  4. Subject: Re: system call in C
  5. In-Reply-To: c23rrj@kocrsv01.delcoelect.com's message of 14 Sep 92 17:04:54 GMT
  6. Message-ID: <GANESH.92Sep14160518@karp.albany.edu>
  7. Originator: ganesh@karp.albany.edu
  8. Sender: ganesh@cs.albany.edu (Ganesh Murugesan)
  9. Organization: Computer Science Department, SUNY at Albany, Albany, NY 12222
  10. References: <1992Sep14.170454.13955@kocrsv01.delcoelect.com>
  11. Date: Mon, 14 Sep 1992 21:05:18 GMT
  12. Lines: 24
  13.  
  14. In article <1992Sep14.170454.13955@kocrsv01.delcoelect.com> c23rrj@kocrsv01.delcoelect.com (Rajnish Joshi) writes:
  15.  
  16.  
  17.  
  18. >   Help !  If I make a system call (from a C prog.) such as
  19. >
  20. >        system (command);
  21. >
  22. >   where 'command' may be a command to compile some program, then how can I
  23. >  obtain the process-id of the process which is doing the compile task. The sytem
  24. >  call returns only the success code. I need to know the pid of the requested
  25. >  command since I want to use it in the C code that follow the system call.
  26. >
  27. >  Thanks
  28.  
  29.  
  30. You cannot do that way. For that you have to do a fork and then execve 
  31.  
  32. to load and execute the program.  (Anyway that is what "system" itself
  33. does)
  34.  
  35. Ganesh
  36. Dept of Comp. Science
  37. SUNY at Albany
  38.