This is the mail archive of the cygwin 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]

apparent bug: incorrect file position after write()


I'm experiencing unexpected behaviour under cygwin that as far as I 
know doesn't happen under linux.  I don't have access to linux to 
test at present.

Some successful write()s to a file increment the file's position by 
more than the count argument.  The extra byte(s) are added to the 
file's size and can be read by lseek()ing to the exact location 
where the extra byte(s) start.  When reading from a location prior 
to this location the extra byte(s) become invisible although they 
can affect the values returned from read() and lseek().

I have other priorities that prevent me from debugging the cygwin 
source code however I have produced some code that reliably 
replicates the problem.  I have attached two source files, one of 
which is the bare minimum to reproduce the problem and the other of 
which does a bit more analysis.  They can each be compiled simply 
by giving the filename as an argument to gcc.

Also attached is a file with the contents of a shell session where 
I demonstrate the results I am getting from the programs on this 
machine.  Finally I have attached the results of the cygcheck -s -v 
-r command.  The 'xyz' directory is not its actual name but this as 
far as I can see is irrelevant to the problem.

Have at it folks...

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm

Attachment: cygcheck.out
Description: Binary data

Attachment: shell.txt
Description: Text document

Attachment: shortnsweet.c
Description: Binary data

Attachment: writetest.c
Description: Binary data

--
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/

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