home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / next / software / 3656 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.3 KB

  1. Path: sparky!uunet!tcsi.com!iat.holonet.net!news.cerf.net!usc!howland.reston.ans.net!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!phylo.genetics.washington.edu!zeno
  2. From: zeno@phylo.genetics.washington.edu (Sean Lamont)
  3. Newsgroups: comp.sys.next.software
  4. Subject: Re: How can a program check to see if user is on console?
  5. Date: 27 Jan 1993 00:55:56 GMT
  6. Organization: University of Washington, Seattle
  7. Lines: 20
  8. Message-ID: <1k4misINNnke@shelley.u.washington.edu>
  9. References: <7466@ucsbcsl.ucsb.edu>
  10. NNTP-Posting-Host: phylo.genetics.washington.edu
  11.  
  12. In article <7466@ucsbcsl.ucsb.edu> doug@foxtrot.ccmrc.ucsb.edu (Douglas Scott) writes:
  13. >I am writing some C code which needs to check to see if the user is logged
  14. >onto the console (i.e., any tty, as long as the user is sitting at the
  15. >console).
  16. >
  17. >What is the easiest way to check to see if this is true?
  18. >
  19. >Thanks in advance.
  20.  
  21. I don't know if this is the easiest, but you can read the user/tty pairs
  22. from /etc/utmp.
  23.  
  24.  
  25.  
  26.  
  27. -- 
  28. Sean T. Lamont                           |   "Don't oppress me, It's
  29. zeno@genetics.washington.edu             |    'computer of color!' "
  30. lamont@abstractsoft.com                  |_______________________________
  31. Abstract Software                                                         
  32.