Is a Process using a Terminal Device?

wbc at cabot.dartmouth.edu wbc at cabot.dartmouth.edu
Thu Oct 26 04:00:21 AEST 1989


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 at DARTMOUTH.EDU		wbc at sunapee.dartvax.uucp
	Bradley Hall, Dartmouth College, Hanover N.H. 03755 (603) 646-3198



More information about the Comp.unix.wizards mailing list