🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.programmer
1 messages
1 total messages Started by david.r.connet Thu, 25 Oct 1990 13:57
How to determine tty device
#1093
Author: david.r.connet
Date: Thu, 25 Oct 1990 13:57
20 lines
1328 bytes
Does anyone know how I can figure out the name of the tty device
I am on?  (Please don't say ttyname(3), I know that.)  The problem
is after opening communication directly to /dev/tty, I need to
figure out which device I'm actually on.  (In case it matters, I'm
on a SVR3.2.2 system.)  ttyname() just reports "/dev/tty".

Background: This is running under layers, and I need to identify
if this is the window that the system is going to use to write
messages to.  (I can't run in that window.)  I'm currently obtaining
the name of the device, stuffing it in a utmp structure and using
the getutline() call to see if there is a utmp entry.  I don't want
to assume that a user has not redirected stdin/stdout (strange things
happen when they do that, so I don't want to allow them that).

Please email me at "dcon@iwtng.att.com" as I don't regularly read
this group.

Thanks in advance.
Dave Connet
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads