This is the mail archive of the
mailing list for the Cygwin project.
Re: Question about cygwin process behaviour and bash interactivemode
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: cygwin at cygwin dot com
- Date: Sat, 14 Sep 2002 14:24:18 -0400 (EDT)
- Subject: Re: Question about cygwin process behaviour and bash interactivemode
- Reply-to: cygwin at cygwin dot com
On Sat, 14 Sep 2002, Christopher Faylor wrote:
> On Sat, Sep 14, 2002 at 01:52:42PM -0400, Igor Pechtchanski wrote:
> >Quoting from isatty source (newlib/libc/posix/isatty.c:12):
> > if (fstat (fd, &buf) < 0)
> > return 0;
> > if (S_ISCHR (buf.st_mode))
> > return 1;
> > return 0;
> >So, isatty() simply checks if the file descriptor given is a character
> >device or not. I'm not sure quite how this works with windows programs
> >started from bash.
> Just a clarification: The 'isatty' that cygwin exports comes from
> extern "C" int
> isatty (int fd)
> int res;
> sigframe thisframe (mainthread);
> cygheap_fdget cfd (fd);
> if (cfd < 0)
> res = 0;
> res = cfd->is_tty ();
> syscall_printf ("%d = isatty (%d)", res, fd);
> return res;
> It specifically checks if the fd in question is a tty.
> I have no comments for the rest of the discussion but I wanted to make
> this point clear.
Thanks for clarifying this. I'm assuming that cmd.exe treats its file
descriptors in the same way, no matter where it's started from (as it
doesn't automatically detect whether to start in an interactive mode).
So the question basically is: what are the properties of the file
descriptors that bash passes to windows processes started from it?
P.S. I don't see the behavior that the original poster described on my
Win2k SP2 system...
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95. Something is wrong here. -- SC sig file
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html