Changes to stdio_filebuf.cc vs 7744_xin.cc

Paolo Carlini pcarlini@unitus.it
Fri Jul 4 20:08:00 GMT 2003


Benjamin Kosnik wrote:

>>I'm trying to understand the last changes to stdio_filebuf.cc, in 
>>particular the use of fwrite, fread and so on in place of the low level, 
>>non blocking, read, write and co...
>>    
>>
>
>I'm having problems with seeking and using fpos. I'm unable to debug
>this at the moment, so I switched this stuff over so this patch could go
>in (hopefully temporarily, until I can figure it out)
>
>You should be able to verify this by replacing xsputn/xsgetn in
>basic_file_stdio.cc to use read/write. Perhaps you could take a look at this?
>  
>
Benjamin, this seems to me the most important point, which I learned the 
hard way in March (I would be happy to be wrong): it seems that you 
cannot intermix flawlessly low level sys calls and C library calls:

    http://gcc.gnu.org/ml/libstdc++/2003-03/msg00146.html
    http://gcc.gnu.org/ml/libstdc++/2003-03/msg00147.html

Therefore if you use C library calls for positioning you have to use 
fread and fwrite but you don't want to do that!

Paolo.



More information about the Libstdc++ mailing list