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-Authenticated: #9087063 Reply-To: From: "Axel Naumann" To: Cc: "'Philippe Canal'" Subject: cyg 1.5.5-1: fgetpos returns -1 problem Date: Mon, 27 Oct 2003 12:10:56 +0100 Message-ID: <000101c39c7a$ff220a70$05010a0a@axel> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Hi, I have a problem with glibc's fgetpos on current cygwin. Looking around I couldn't find a previous posting on it. Running this test program: --- #include int main(int argc,char**argv) { FILE *file = fopen("fo.C","rb"); // use any existing file here FILE *write= tmpfile(); char c = fgetc(file); fpos_t pos; fpos_t wpos; while (c!=EOF) { c = fgetc(file); fputc(c,write); fgetpos(file,&pos); fgetpos(write,&wpos); fprintf(stderr,"%d vs %d\n",pos,wpos); } fseek(write,0,SEEK_SET); c = fgetc(write); while (c!=EOF) { fprintf(stderr,"%c",c); c = fgetc(write); fgetpos(write,&wpos); fprintf(stderr,"%d\n",wpos); } return 0; } --- gives --- [...] r569 e570 t571 u572 r573 n574 575 0576 ;577 578 }579 580 581 582 --- on linux - which is what I'd expect to see. On cygwin 1.5.5-1, gcc 3.3.1-2 not in mingw mode (other relevant packages updated today) the same code gives --- [...] r-1 e-1 t-1 u-1 r-1 n-1 -1 0-1 ;-1 -1 }-1 -1 --- Is this different behaviour on linux and cygwin expected? I reverted to gcc 3.2 to do a regression check, but the problem persists. If someone points me to how to revert my glibc to an older version I'm happy to add the results of the regression test. Any help solving this suprising behaviour is appreciated; if someone needs more input to reproduce it please let me know. Best regards, Axel. -- 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/