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 X-Authentication-Warning: eos.vss.fsi.com: ford owned process doing -bs Date: Tue, 16 Sep 2003 14:22:33 -0500 (CDT) From: Brian Ford X-X-Sender: ford AT eos To: cygwin AT cygwin DOT com Subject: Re: isatty bug Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Was that stock Cygwin gdb that crashed? Try this: $ cat stest.c #include #include int same_tty_p (int fd1, int fd2) { struct stat stat1, stat2; return (fstat(fd1, &stat1) >= 0 && fstat(fd2, &stat2) >= 0 && stat1.st_dev == stat2.st_dev && stat2.st_ino == stat2.st_ino); } int main(void) { printf("0/1: %d\n1/2: %d\n2/0: %d\n",same_tty_p(0,1), same_tty_p(1,2),same_tty_p(2,0)); printf("stat %d bytes\n", sizeof(struct stat)); } ford AT fordpc ~ $ gcc -o stest stest.c ford AT fordpc ~ $ ./stest 0/1: 1 1/2: 1 2/0: 1 stat 96 bytes $ nm stest.exe | grep fstat 00402970 T __fstat64 004060a4 I __imp___fstat64 004060e0 I __imp__fstat 004027a0 T _fstat Make sure struct stat is 96 bytes and you are calling fstat64. -- Brian Ford Senior Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety International Phone: 314-551-8460 Fax: 314-551-8444 -- 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/