[comp.unix.wizards] When does access date get set on tty device

mcvic@prcrs.UUCP (David McVicar) (08/28/90)

Question:

At what point does the st_atime field in the inode get updated when writing
to a tty device?

1.) When the read() system call completes?
2.) When the char written is put on the tty output queue? 
3.) When the char written is actually sent to the device?
4.) It depends?


Problem: We have 300 baud devices that take too long to print reports and 
 	 our auto-logout daemon detects an old access time and
	 no cpu usage for that tty and terminates the user's processes.


Thanks in advance,
Dave McVicar
-- 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
    David J. McVicar 		...!uunet!prcrs!mcvic
   PRC Realty Systems 
   McLean, VA   22102

cpcahil@virtech.uucp (Conor P. Cahill) (08/28/90)

In article <1067@prcrs.UUCP> mcvic@prcrs.UUCP (David McVicar) writes:
>Question:
>
>At what point does the st_atime field in the inode get updated when writing
>to a tty device?

The st_atime will be updated by a call to any of the following system calls:

	creat, mknod, pipe, utime, and read.

st_mtime will be updated by a call to any of the following system calls:

	creat, mknod, pipe, utime, and write.

(Actually the *time is updated following completion of the operation, just
 prior to the system call returning)

>Problem: We have 300 baud devices that take too long to print reports and 
> 	 our auto-logout daemon detects an old access time and
>	 no cpu usage for that tty and terminates the user's processes.

You probably want to use the latter of st_atime and st_mtime for your idle
time calculations.


-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170