Reputation: 301
I've written new system call that can terminate all the children of a given process, and I want to use this system call when user calls the "exit()" system call.
In fact, The "exit" system call will also be modified. If the "priority" value of the process which has executed the "exit" system call is greater than 30 then the "exit" system call will also use the my own new system call.
To do this, I've changed "do_exit" function in the /kernel/exit.c but it didn't work.
void do_exit(long code){
struct task_struct *tsk = current;
int group_dead;
if(tsk->prio > 30){
my_own_sys_call(tsk->pid);
}
...
}
Should I call my own system call in the "do_exit" ? If yes, I don't know call in which part of the function
By the way, I'm not sure about "prio" to get priority of process, because there are a lot of elements like that "prio", "static_prio", "normal_prio", "rt_priority" with regard priority in "task_struct".
Upvotes: 0
Views: 826