When does access date get set on tty device

Conor P. Cahill cpcahil at virtech.uucp
Tue Aug 28 23:12:09 AEST 1990


In article <1067 at prcrs.UUCP> mcvic at 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 



More information about the Comp.unix.wizards mailing list