Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!mgnetp!ihnp4!zehntel!hplabs!sri-unix!fouts@ames-unixb.ARPA From: fouts@ames-unixb.ARPA Newsgroups: net.unix-wizards Subject: Style question - how to kill process based on user name / tty? Message-ID: <12440@sri-arpa.UUCP> Date: Tue, 14-Aug-84 12:34:00 EDT Article-I.D.: sri-arpa.12440 Posted: Tue Aug 14 12:34:00 1984 Date-Received: Thu, 16-Aug-84 02:18:58 EDT Lines: 29 From: Martin Fouts[] I now find myself with a system running 4.2bsd Unix on which I have operators who from time to time will have to kill off a process for a user. Usually the user will know their username and sometimes they will know their terminal id, but rarely will they know the actual process id to kill. Although I could train my operators to use ps to find the process number, I would rather use an approach in which the operator fed the username and tty id to a program which then listed the processes belonging to that user on that tty and asked which ones to kill. The question is: What is the cleanest way using C to determine which processes belong to (who owns whom here anyway?) a given tty? The routine has to work for 4.2, and it would be nice if it would also work for system 5. Please reply to me at fouts@ames-nas-gw and I will sumarize if there is enough interest. Thanks in advance Martin Fouts NASA Ames Research Center fouts@ames-nas-gw