[comp.unix.wizards] Is a Process using a Terminal Device?

wbc@cabot.dartmouth.edu (10/26/89)

I have a sun system, running SunOS 4.0.3, and I would like to
be able to tell when a terminal (/dev/ttyp?) has a user logged
in to it, via an ioctl.  This is because when dump(8) with the n
flag tries to notify all operators that the dump is done, it looks
in utmp, which often has entries which are out of date.  Dump
then tries to fopen the tty (which has no one logged in) and 
hangs forever, thus keeping the dump from ending cleanly.
Right now I am looking at the st_mode flag, which changes when 
the tty is in use, but I hope there is a more elegant solution.

	Wayne Cripps
	wbc@DARTMOUTH.EDU		wbc@sunapee.dartvax.uucp
	Bradley Hall, Dartmouth College, Hanover N.H. 03755 (603) 646-3198