This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

1.5.0: Problem with fseeko() after fdopen()

I'm running 1.5.0 with all the latest test packages installed.

I recently noticed a problem with the test release of patch and its
ability to read from stdin.  I started to investigate and have
extracted the problematic code from patch into a test program.

The program (and patch) use open() to create/open a file and then
use fdopen() on the resulting file descriptor.  The file is opened
in RW mode, some data is written to it, the file is flushed, and
then an attempt is made to seek to the beginning of the file.

This last seek fails.  The seek is done using fseeko().  If fseek()
is used instead, all is fine.

I did a bit of debugging in newlib and determined that fdopen()
doesn't set pfp->_seek64, which causes the problem.  If I use
fopen() to create the file, then pfp->_seek64 is set (since fopen()
ends up calling fopen64()).

I must admit at this point to complete ignorance about how the large
file support actually works and how fseeko() magically get resolved
to fseeko64().

Is fdopen() still supported in 1.5.0?  Am I doing something else
wrong?  I have cygwin1.dll built from CVS with debugging symbols and
some curiousity, so if anyone has suggestions on how to proceed
debugging, I'd be happy to listen.

My test program to demonstrate the problem (all copied from patch
sources) and cygcheck output are attached.


Attachment: tst.c
Description: test program

Attachment: cygcheck.out
Description: Text document

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]