Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!ut-sally!seismo!mcvax!ukc!hrc63!nwh From: nwh@gec-rl-hrc.co.uk (Nigel Holder Marconi) Newsgroups: net.unix-wizards,net.unix Subject: which is my login terminal Message-ID: <34@gec-rl-hrc.co.uk> Date: Tue, 24-Jun-86 13:27:08 EDT Article-I.D.: gec-rl-h.34 Posted: Tue Jun 24 13:27:08 1986 Date-Received: Sat, 28-Jun-86 01:02:18 EDT Organization: GEC Hirst Research Centre, Wembley. U.K. Lines: 20 Keywords: sun, control terminal Xref: watmath net.unix-wizards:18608 net.unix:8408 I have an application that needs to know whether I am logged on at the console to decide whether I can paint all over the sun bit-mapped screen. I could be in suntools, a pty (either via suntools, remote login or any windowing system), the normal console, device, or an external port (eg. ttya). What I really need to know is whether I actually logged in at the console for this session. As other people might want to run the application the solution must be general. If I'm not on a pty then it is possible to use ttyname(). Otherwise, how is it possible ? (I've thought about finding out somehow whether my pty and its associated winxx device are installed in the suntools environment, but haven't pursued it yet). Nigel Holder UK JANET: yf21@uk.co.gec-mrc.u Marconi Research, ARPA: yf21%u.gec-mrc.co.uk@ucl-cs Chelmsford, Essex. CM2 8HN. +44 245 73331 ext. 3219 / 3214