[ECOS] fopen() with 'w+' does not set O_CREAT
Wed Mar 24 16:20:00 GMT 2004
I believe the mode settings have been implemented incorrectly for
fopen(). If a file is opened 'w+', it should have O_CREAT set:
w+ Open for reading and writing. The file is created
if it does not exist, otherwise it is truncated.
The stream is positioned at the beginning of the
However fopen() only sets O_RDWR, without O_CREAT. This is because w+ is
translated to CYG_STREAM_READWRITE by process_mode(), which is
translated to O_RDWR by cyg_stdio_open().
This was mentioned on the list a while ago but didn't seem to have any
Have I missed something here ? If not I'll send a patch.
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss