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]

Strange behaviour w/ read/write


I am using the current cygwin version (dll version 1-5-5-1) and see some
strange behaviour while using the read/write system calls.
In short: I open a file with mode O_RDWR|O_CREAT, write exactly 1MB into it
and then after seeking to position 0 read the Megabyte back. Strange things
seem to happen:
 - The File becomes larger during the whole process (up to some hundred bytes)
 - I get an end of file most of the times though i did not read all the 1MB
 - sometimes (5% of all runs) i get an EAGAIN error while reading the file

 has anybody experienced something similar? I make heavy use of threads writing
 different files at the same time (but not more than 1 thread per file).
 I suspect cygwin to write sometimes into the wrong file. I had not been able
 to reproduce this with a simple test-program, so i do not provide sample
 code here, but perhaps someone has experienced similar effects? And perhaps
 someone knows why i am getting EAGAIN-errors on diskfiles (i do not use
 nonblocking io)?

Greetings - Rasmus


Unsubscribe info:
Problem reports:

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