From:	SMTP%"tihor@acf4.NYU.EDU" 16-NOV-1990 23:45:31.63
To:	tihor@acf4.NYU.EDU
CC:	
Subj:	Re: Reading from terminal in SYLOGIN.COM under DECWINDOWS.

Received: from acf4.NYU.EDU by ACF7.NYU.EDU with SMTP; 
          Fri, 16 Nov 1990 23:45:24 EST
Received: by acf4.NYU.EDU (5.61/1.34)
	id AA10247; Fri, 16 Nov 90 23:42:40 -0500
Date: Fri, 16 Nov 90 23:42:40 -0500
From: tihor@acf4.NYU.EDU (Stephen Tihor)
Message-Id: <9011170442.AA10247@acf4.NYU.EDU>
To: tihor@acf4.NYU.EDU
Subject: Re: Reading from terminal in SYLOGIN.COM under DECWINDOWS.
Newsgroups: comp.os.vms
In-Reply-To: article <9011151914.AA06046@ucbvax.Berkeley.EDU> of 15 Nov 90 13:24 EST

/* acf4:comp.os.vms / dragon@NSCVAX.PRINCETON.EDU /  1:24 pm  Nov 15, 1990 */

     Mark (London?) <MRL@NERUS.PFC.MIT.EDU> writes:
>
>I have a program which is run in SYLOGIN.COM and prompts a user for input.
>However, under DECWINDOWs, if I install this program, a window doesn't get
>created.  The attempt to input from the terminal causes the window creation
>to fail.  I'm guessing that somehow it is reading from the session manager
>window or some other weirdness.  Even putting a simple INQUIRE doesn't work.
>I did try a READ from TT:, and that simply caused the session manager to
>hang, requiring a reboot.  Is there any way which I can test to see if the
>terminal is available to be read from?  Thanks.
>								Mark
>
>
     I tripped over this one about two weeks ago.  The problem is that 
DECWindows applications, including DECTerm, are created as detached 
processes with SYS$INPUT and SYS$OUTPUT defined as mailboxes.  When they
are created, they read and execute SYSLOGIN.COM and LOGIN.COM.  After they
get started, they redefine SYS$INPUT and SYS$OUTPUT to be terminal devices
and read and execute SYLOGIN.COM and LOGIN.COM _again_!

     The fix is 
$ IF F$GETDVI("SYS$OUTPUT", "TRM") THEN run program.
Alternatively,
$ IF .NOT. F$GETDVI("SYS$OUTPUT", "TRM") THEN GOTO 10$
$ READ things
$ WRITE things
$ 10$

     This ensures that you don't read/write the mailboxes.

*************************************************************************
*									*
*			Here, there be dragons!				*
*		      dragon@nscvax.princeton.edu			*
*									*
*						Richard B. Gilbert	*
*************************************************************************
/* ---------- */

