Wine | Bug Query

Akarsha Sehwag akarsha15010 at iiitd.ac.in
Sun Mar 26 07:55:32 CDT 2017


Hi
I started with the bug( https://bugs.winehq.org/show_bug.cgi?id=39640 ).
As of what I understood, I am writing it below. Kindly correct me
wherever I go wrong.
To implement ProcessPage_OnEndProcessTree() correctly we need to kill
all its children and grandchildren also.
So for that purpose, we need to iterate through all the active
processes and check if their parent process is same as the process we
wish to terminate. If yes, we kill them, if no, we continue our
iteration.
Now, for implementing this, can we use 'ps' or 'top' command.
An example code:

char string[30] = "ps -o pid --ppid ";
char ppid[7];
sprintf(ppid , "%d" , getpid() ) ;
strcat ( string , ppid ) ;
system ( string ) ;

ps -o pid --ppid <parent_Id>  will give us the pid of all the
child_processes whose parent has a PID. And now, get the parentProcess's
PID by getpid(). Next, convert the integer into string and concatenate
the result with string to get the final command which is then executed
by system(string).

Kindly tell me if I am anywhere near the right solution and also guide
me how to proceed.

Thanks :)
Regards
--
Akarsha Sehwag



More information about the wine-devel mailing list