fix(stdio): correct position tracking on mode switch and free owned buffers on close
This commit is contained in:
+7
-1
@@ -206,7 +206,13 @@ fseeko(FILE *stream, off_t offset, int whence);
|
||||
long
|
||||
ftell(FILE *stream);
|
||||
|
||||
__attribute__((pure)) off_t
|
||||
/*
|
||||
* Not marked pure: the implementation can allocate the stream buffer on
|
||||
* first use (an observable side effect), so the compiler must not elide
|
||||
* or reorder the call. (feof/ferror/fileno below are genuinely read-only
|
||||
* and keep their pure attribute.)
|
||||
*/
|
||||
off_t
|
||||
ftello(FILE *stream);
|
||||
|
||||
/* Rewind to the start and clear feof/ferror (equivalent to
|
||||
|
||||
Reference in New Issue
Block a user