[comp.sys.hp] Stat

abell@polyslo.CalPoly.EDU (abell) (05/23/89)

Hello all.  I have an HP 9000 Model 550 using Operating System version 5.11.
Has anyone had experience using the stat(2) system call in conjunction with
a login tty to determine a users idle time.  I've looked at all three time
variables, st_atime, st_mtime and st_ctime.  It appears to me that st_atime
and st_mtime contain the the systems boot time and st_ctime contains the
users login time.  But from the documentation, st_atime should contain the
time of last access.  So it would seem that these variables are not being
updated properly.  Is there some other way to do this or maybe I'm doing
something wrong here?  Any help would be greatly appreciated.

-- 
Alan C. Bell  (abell@polyslo.calpoly.edu)
Computer Science Department			..!ucbvax!voder\
California Polytechnic State University		..!sdcrdcf!csun |!polyslo!abell
San Luis Obispo, CA 93407 (805)756-7185	     ..!lll-crg!csustan/

mcb@hpfcdc.HP.COM (Michael Berry) (05/25/89)

> But from the documentation, st_atime should contain the
> time of last access.  So it would seem that these variables are not being
> updated properly.  Is there some other way to do this or maybe I'm doing
> something wrong here?  Any help would be greatly appreciated.

Your observation is correct - device file time st_atime isn't handled
correctly for device files.  I believe that the touch(1) command will
change them.

Michael Berry   ARPA:mcb%hpfcde@hplabs.HP.COM   UUCP:hplabs!hpfcla!mcb