🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.software
Article #1755

Re: How can a program check to see if user is on console?

#1755
From: Sean Lamont
Date: Wed, 27 Jan 1993 00:55
20 lines
1344 bytes
In article <7466@ucsbcsl.ucsb.edu> doug@foxtrot.ccmrc.ucsb.edu (Douglas Scott) writes:
>I am writing some C code which needs to check to see if the user is logged
>onto the console (i.e., any tty, as long as the user is sitting at the
>console).
>
>What is the easiest way to check to see if this is true?
>
>Thanks in advance.

I don't know if this is the easiest, but you can read the user/tty pairs
from /etc/utmp.




-- 
Sean T. Lamont                           |   "Don't oppress me, It's
zeno@genetics.washington.edu             |    'computer of color!' "
lamont@abstractsoft.com                  |_______________________________
Abstract Software                                                         
Technical Details
Message-ID: <1k4misINNnke@shelley.u.washington.edu>
Path: arc1-ca.pugleaf.net!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
References: <7466@ucsbcsl.ucsb.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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
From: zeno@phylo.genetics.washington.edu (Sean Lamont)
Newsgroups: comp.sys.next.software
Subject: Re: How can a program check to see if user is on console?
Date: 27 Jan 1993 00:55:56 GMT
Organization: University of Washington, Seattle
Lines: 20
Message-ID: <1k4misINNnke@shelley.u.washington.edu>
References: <7466@ucsbcsl.ucsb.edu>
NNTP-Posting-Host: phylo.genetics.washington.edu