Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sat, 14 Sep 2002 14:01:31 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Question about cygwin process behaviour and bash interactive mode Message-ID: <20020914180131.GB12553@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i 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 winsup/syscalls.cc: extern "C" int isatty (int fd) { int res; sigframe thisframe (mainthread); cygheap_fdget cfd (fd); if (cfd < 0) res = 0; else 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. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/