delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/09/16/13:37:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 16 Sep 2003 13:36:30 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Sam Steingold <sds AT gnu DOT org>
cc: cygwin AT cygwin DOT com
Subject: Re: isatty bug
In-Reply-To: <upti0vdxo.fsf@gnu.org>
Message-ID: <Pine.GSO.4.56.0309161332390.12411@slinky.cs.nyu.edu>
References: <usmmxyckr DOT fsf AT gnu DOT org> <20030916100108 DOT GO9981 AT cygbert DOT vinschen DOT de>
<uwuc8x09i DOT fsf AT gnu DOT org> <20030916171951 DOT GA21860 AT redhat DOT com> <upti0vdxo DOT fsf AT gnu DOT org>
Importance: Normal
MIME-Version: 1.0

On Tue, 16 Sep 2003, Sam Steingold wrote:

> > * Christopher Faylor <pts-epz AT pltjva DOT pbz> [2003-09-16 13:19:51 -0400]:
> >
> > On Tue, Sep 16, 2003 at 10:42:49AM -0400, Sam Steingold wrote:
> > >>* Corinna Vinschen <pbevaan-pltjva AT pltjva DOT pbz> [2003-09-16 12:01:08 +0200]:
> > >>
> > >> On Mon, Sep 15, 2003 at 05:19:16PM -0400, Sam Steingold wrote:
> > >> > calling isatty(0) in a program results in a segfault:
> > >> And the version number of the DLL is ...
> > >
> > >1.5.4(0.94/3/2)
> > >
> > >> Fd 0 is a tty, a console window, a tape drive, a ...
> > >
> > >I am doing this in a windows console, as created by clicking on the
> > >cygwin icon, i.e., in the bash shell.
> > >I assume that 0 means stdin.
> > >
> > >> Reproducible testcase is ...
> > >
> > >------- scratch.c ----
> > >#include <stdio.h>
> > >int main (void) {
> > >#define Y_N(x)  ((x) ? "(TTY)" : "(not a TTY)")
> > >  printf("0: %s %s\n1: %s %s\n2: %s %s\n",
> > >         ttyname(0),Y_N(isatty(0)),ttyname(1),Y_N(isatty(1)),
> > >         ttyname(2),Y_N(isatty(2)))
                                        ^
> > >#undef Y_N
> > >  return 0;
> > >}
> > >------- scratch.c ----
> >
> > Fixing the obvious typo in the above provides the desired results both
> > inside gdb and outside gdb.  With CYGWIN=tty and with CYGWIN=notty.
>
> what is the "obvious typo"?

Aw, come on, try to at least *compile* the code you posted, will ya? ;-)
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019