Originally posted by THETEZ
what value should i use to kill all children from the parent?
When calling fork() it returns that pid of the child. If you save those pid's, say, to an array of pid's you can kill them looping through the array.
Or you could loop through all pid's in /proc, killing all processes that have their parent ID set to the pid of the parent (which you can get with getpid())
I think there's no "special way" to do this.