Still, what you are doing is inherently racy. The very moment you pass the PIDs to your program, they can already be gone and reused. You can end up kill()ing a different PID. I don&#x27;t think you can use this for anything serious.
In what situation do you think it might be acceptable?
EDIT: You are trying to implement process groups in user space.