Article 6JCK9 executing a new program in the same process ID

executing a new program in the same process ID

by
Skaperen
from LinuxQuestions.org on (#6JCK9)
it is easy enough to execute a new program image in the same process ID when running the execve() call in that same process. but i need to do something a bit different. i will have a process running program ABC which would be a binary image compiled and linked for Linux. after ABC ends, i want to run program XYZ in that very same process ID. but, program ABC has no code at its end to execute XYZ. changing the source code of ABC to do a re-compile is not an option because the source code is not available. i'd like to know if anyone has put together something that can accomplish this. my first thought is doing a dynamic loading of ABC in order to get control back at the end of ABC while still in the same process. i would think this needs to be in C. any ideas?

i know, many of you will wonder why i need to run XYZ in the same process. well i could work around it. but it would be a lot of automatically processing many output streams to fake process IDs, so i am looking at this as the simpler solution.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments