home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / programm / 5769 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.2 KB

  1. Path: sparky!uunet!virgin!unhtel!mozz.unh.edu!nymph.msel.unh.edu!sch
  2. From: sch@nymph.msel.unh.edu (Shane C Hutchins aka Xenos)
  3. Newsgroups: comp.unix.programmer
  4. Subject: How long has my screen been idle...?
  5. Date: 22 Dec 1992 15:42:49 GMT
  6. Organization: UNH Marine Systems Eng Lab/Computer Science
  7. Lines: 20
  8. Message-ID: <1h7d1pINNl8b@mozz.unh.edu>
  9. NNTP-Posting-Host: nymph.msel.unh.edu
  10.  
  11.   I was wondering what the best/easiest way to check how long
  12.   its been since your (tty) screen has been sent anything...
  13.   (I'd expect this to be 'close' to your idle time.  I don't 
  14.    want the time my session has been idle!)
  15.  
  16.   The last time you typed something...can be determined by:
  17.   if ((fstat(0, &statbuf)) != 0) {
  18.       fprintf(stderr, "%s: couldn't stat tty\n", pname);
  19.       exit(1);
  20.       }
  21.   I thought a fd of 1 might work...but It doesn't.
  22.  
  23.   (I'm using a Sun SparcStation IPC, SunOS Release 4.1.1)
  24.  
  25.   If any of you know how to determine the time since my screen
  26.   has been sent a char, please let me know by e-mail <sch@unh.edu>.
  27.   I'll post a summary.
  28. -- 
  29.   -Shane C Hutchins   "Any sufficiently advanced technology is
  30.      sch@unh.edu       indistinguishable from magic." (Arthur C. Clarke)
  31.