Style question - how to kill process based on user name / tty?

fouts at ames-unixb.ARPA fouts at ames-unixb.ARPA
Wed Aug 15 02:34:00 AEST 1984


From:  Martin Fouts <fouts at ames-unixb.ARPA>


[]

	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 at ames-nas-gw and I will sumarize if
there is enough interest.

	Thanks in advance

Martin Fouts
NASA Ames Research Center
fouts at ames-nas-gw



More information about the Comp.unix.wizards mailing list