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