Hi.
I have a program that will launch some processes. At a given time, other program may decide to kill some of the child processes of the original process. The trouble is that the logic used to know which processes to kill needs to know the command line arguments used to call them.
So far I have got to get the tree of the process children and grandchildren using getprocs, but I just found out that it does not return the process command line.
I have found that "ps -o args" shows the arguments, so they must be accessible somewhat, but I just do not know which system call use. I do not want to use ps because the system is going to be installed in other computers and I do not want it to depend of a particular implementation of ps. Also the ps documentation says that sometimes the args info just cannot be retrieved, but I would like to get to the actual system calls to know if they are more specific.
Thanks In Advance. Sergio.
I have a program that will launch some processes. At a given time, other program may decide to kill some of the child processes of the original process. The trouble is that the logic used to know which processes to kill needs to know the command line arguments used to call them.
So far I have got to get the tree of the process children and grandchildren using getprocs, but I just found out that it does not return the process command line.
I have found that "ps -o args" shows the arguments, so they must be accessible somewhat, but I just do not know which system call use. I do not want to use ps because the system is going to be installed in other computers and I do not want it to depend of a particular implementation of ps. Also the ps documentation says that sometimes the args info just cannot be retrieved, but I would like to get to the actual system calls to know if they are more specific.
Thanks In Advance. Sergio.