![]() |
| | #1 |
| Registered User Join Date: Mar 2003
Posts: 4
| Returning PID from execve family of functions? Just wondering if it's possible to programatically get the PID of an app that has just been executed using one of the execve(2) family of functions? For context, I'm writing an app that will execute an application specified on the command line, retrieve it's process id, and monitor various parameters over time, producing a graph. While I am writing this on Linux, it has to be portable so GNU/BSD extensions to ANSI C aren't any use to me unfortunately. Any ideas at all would be appreciated, I have the feeling I'm missing something simple :-/ TIA, Ruairi |
| ruairi is offline | |
| | #2 |
| Guest
Posts: n/a
| are you using fork to spawn a child process which then uses one of the execve(2) family of functions? If so upon successful completion, fork() and fork1() return 0 to the child process and return the process ID of the child process to the parent process. Hope that helps |
|
| | #3 |
| Registered User Join Date: Mar 2003
Posts: 4
| Thanks for the reply 'Twas just what I needed. |
| ruairi is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| returning arrays from functions | Leeman_s | C++ Programming | 11 | 06-05-2002 10:00 PM |
| API "Clean Up" Functions & delete Pointers :: Winsock | kuphryn | Windows Programming | 2 | 05-10-2002 06:53 PM |
| returning functions w/ sockets | JagWire | Windows Programming | 4 | 03-11-2002 05:00 PM |
| Passing & Returning Strings from Functions | nisaacs | C Programming | 1 | 01-30-2002 05:34 AM |
| Class accessor functions returning strings? | Shadow12345 | C++ Programming | 6 | 12-31-2001 12:48 PM |