[En-Nut-Discussion] fseek beyonf EOF on PHAT

Ole Reinhardt ole.reinhardt at embedded-it.de
Mon Jul 4 16:01:04 CEST 2011

Hi all,

while porting a little program from Linux to NutOS I just found an
incompatibility issue with our current fseek implementation on PHATFS.


says, that fseek should allow setting the file pointer beyond the end of
file and should fill up the gap with 0 if write to the file follows.

Currently setting the file pointer beyond EOF results in a more or less
undefined bahaviour and no error code is returned by fseek (return value
is always 0). Instead it seems that the filepointer is not modified.

At least fseek should return an error, but I would prefer to implement
the proposed behaviour.

I would like to know your opinion...




Thermotemp GmbH, Embedded-IT

Embedded Hard-/ Software and Open Source Development, 
Integration and Consulting


Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen - 
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97

Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280 

More information about the En-Nut-Discussion mailing list