🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#1762
From: Andrew Loewenstern
Date: Tue, 26 Jan 1993 19:00
17 lines
1197 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?

Reading the /etc/utmp file is the easiest way.  Check the utmp man
page for the format.


andrew
-- 
andrew@cubetech.com      | "We cannot dwell in the time that is to come,
Andrew Loewenstern       |  lest we lose our now for a phantom of our
Cube Technologies, Inc.  |  own design." - Erendis      FYEO Public Key:
0000000701B61D1ADF0DFC9C16185CEA055200000007EB4A9FEB1922065D471A89E905B5
Technical Details
Message-ID: <1993Jan26.190016.5811@cubetech.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!elroy.jpl.nasa.gov!swrinde!gatech!hubcap!ncrcae!ncrhub2!ncrgw2!psinntp!cubetech.com!imladris!andrew
References: <7466@ucsbcsl.ucsb.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.software
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!elroy.jpl.nasa.gov!swrinde!gatech!hubcap!ncrcae!ncrhub2!ncrgw2!psinntp!cubetech.com!imladris!andrew
From: andrew@cubetech.com (Andrew Loewenstern)
Subject: Re: How can a program check to see if user is on console?
Message-ID: <1993Jan26.190016.5811@cubetech.com>
Organization: Cube Technologies, Inc.
References: <7466@ucsbcsl.ucsb.edu>
Date: Tue, 26 Jan 1993 19:00:16 GMT
Lines: 17