*BSD News Article 28707


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!mel.dit.csiro.au!its.csiro.au!dmssyd.syd.dms.CSIRO.AU!metro!news.cs.su.oz.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!gatech!swrinde!sgiblab!cs.uoregon.edu!nntpserver!cogswell
From: cogswell@creampie.cs.uoregon.edu (Bryce Howard Cogswell)
Newsgroups: comp.os.386bsd.questions
Subject: Re: [FreeBSD] tcsh can't access tty
Date: 18 Mar 94 15:37:35
Organization: /home/faculty/cogswell/.organization
Lines: 52
Message-ID: <COGSWELL.94Mar18153735@creampie.cs.uoregon.edu>
References: <2m936a$gq0@agate.berkeley.edu>
	<COGSWELL.94Mar17125540@creampie.cs.uoregon.edu>
	<1994Mar18.163305@cs.utwente.nl>
NNTP-Posting-Host: creampie.cs.uoregon.edu
In-reply-to: olah@cs.utwente.nl's message of Fri, 18 Mar 1994 15:33:05 GMT

olah@cs.utwente.nl (Andras Olah) writes:

   cogswell@creampie.cs.uoregon.edu (Bryce Howard Cogswell) writes:
   |> #ifndef HAVE_DISC
   |> # if defined(TIOCGETD) && defined(NTTYDISC)
   |>     if (ioctl(f, TIOCGETD, (ioctl_t) & oldisc) == 0) {
   |>         if (oldisc != NTTYDISC) {
   |>             int     ldisc = NTTYDISC;
   |> 
   |>             if (ioctl(f, TIOCSETD, (ioctl_t) & ldisc) != 0)
   |>                 return (-1);
   |>             add_discipline = 1;
   |>         }
   |>         else
   |>             oldisc = -1;
   |>         return (0);
   |>     }
   |>     else
   |>         return (-1);
   |> # else					<<<< NEW !!!
   |>     return (0);				<<<< CODE !!!
   |> # endif /* TIOCGETD && NTTYDISC */
   |> #endif  /* !HAVE_DISC */


   The hack you describe IS included into the source distribution of tcsh in 
   the packages directory.  ...  The problem is that the new code you mention 
   is not compiled into the code, because TIOCGETD and NTTYDISC are indeed 
   defined. 

Damn.  Right you are.  Like I said, I didn't have the original sources to do
a diff.  Okay, add this (this is what I did):

#ifdef FreeBSD
#  undef NTTYDISC
#endif

to the top of the tc.disc.c file, as well as adding the patch to the setdisc()
function.  While you're at it, you better add

	DFLAGS=-DFreeBSD

to the Makefile.  The problem is indeed that NTTYDISC is defined but appears 
to be unsupported.  

The net result is that even if you don't set the line discipline
at all tcsh runs great with full command line editing and job control.
Don't ask me why.  

Sorry about the half-fix in the first post.

-- Bryce