It's called "security". You're not
to be able to kill somebody else's processes. If it's something you
do from a non-priviledged account: be very, very careful. A couple of ways of doing this are sudo and setuid, but as I said, be very, very careful - what if someone else were to run this program?