RE: Getting pid of exec'd process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

If you are doing execv after creating a child process using fork, then
return value of fork will give you the pid of the process.

If you haven't done any fork, then the pid is same the calling process
(execv doesn't create any new process, it overwrites the process image
of calling one) and can be obtained using the getpid() system call.

Regards,
Cyon P.J.

-----Original Message-----
From: linux-c-programming-owner@xxxxxxxxxxxxxxx
[mailto:linux-c-programming-owner@xxxxxxxxxxxxxxx] On Behalf Of Prasanta
Sadhukhan
Sent: Thursday, March 22, 2007 4:42 PM
To: linux-c-programming@xxxxxxxxxxxxxxx
Subject: Getting pid of exec'd process

Hi,

Can anyone suggest as to how can I get the pid of the process which I
have done execv()?
ie, if I do execv(path, cmd) a new process will be launched and now how
can I get the pid of this new process?

Regard
Prasanta

-
To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in the body of a message to
majordomo@xxxxxxxxxxxxxxx More majordomo info at
http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux