diff --git a/libs/libc/include/stdio.h b/libs/libc/include/stdio.h index 885ce8c4..143408b8 100644 --- a/libs/libc/include/stdio.h +++ b/libs/libc/include/stdio.h @@ -63,12 +63,18 @@ extern "C" /* Moves stream's read/write offset by offset, depending on whence. */ int fseek(FILE* stream, long offset, int whence); + /* Moves stream's read/write offset by offset, depending on whence. */ + int fseeko(FILE* stream, off_t offset, int whence); + /* Moves stream's read/write offset to the offset stored in the pos structure. */ int fsetpos(FILE* stream, const fpos_t* pos); /* Returns the current offset for stream. */ long ftell(FILE* stream); + /* Returns the current offset for stream. */ + off_t ftello(FILE* stream); + /* Stores the current offset for stream in the pos structure. */ int fgetpos(FILE* stream, fpos_t* pos); diff --git a/libs/libc/src/file.cpp b/libs/libc/src/file.cpp index 24cf10b5..ce288401 100644 --- a/libs/libc/src/file.cpp +++ b/libs/libc/src/file.cpp @@ -192,6 +192,11 @@ extern "C" return 0; } + int fseeko(FILE* stream, off_t offset, int whence) + { + return fseek(stream, offset, whence); + } + int fsetpos(FILE* stream, const fpos_t* pos) { return fseek(stream, *pos, SEEK_SET); @@ -204,6 +209,11 @@ extern "C" // maybe? We'd have to update this value in fread() and fwrite() as well... } + off_t ftello(FILE* stream) + { + return ftell(stream); + } + int fgetpos(FILE* stream, fpos_t* pos) { long result = ftell(stream);