From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3695 invoked from network); 4 May 2000 13:33:29 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 May 2000 13:33:29 -0000 Received: (qmail 29594 invoked by alias); 4 May 2000 13:33:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11150 Received: (qmail 29578 invoked from network); 4 May 2000 13:33:20 -0000 Date: Thu, 4 May 2000 15:33:17 +0200 (MET DST) Message-Id: <200005041333.PAA02841@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Thu, 4 May 2000 14:55:13 +0400 Subject: RE: PATCH: Re: zpty and controlling tty (and other fd's) Andrej Borsenkow wrote: > > On True64 Unix O_NOCTTY is implicit and cannot be unset. How weird. > > Hmm ... if I correctly recall, first tty opened by process becomes > controlling tty. It means, that if child has closed all of it's file > descriptors and reopens tty for stdin (duplicating it for stdout, > stderr) - it gets it as controlling tty. It should be fairly portable. What I said with the above is that on True64 Unix opening a terminal in a process with no controlling tty does *not* make that terminal the controlling tty of the process. So: `how weird'. > ... > > Note fd's 3 and 13. 3 is master side of pty (child does not need it, > does it?) Of course I tried to close it -- and on Linux this messed up the parent's (i.e. the shell's) terminal settings. Don't know how this came. > And 13 is left over from wordcode file mapping. Mapping itself > goes away after exec (at least here - I expect, it should be true for > all Unices) - but we have to close fd anyway. Ah, right. I don't use wordcode files in development versions. This adds the closedumps() function and makes it be called in zpty.c and zexecve(). Does anyone know of other places where it should be called? Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de