summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibC/stdio.cpp11
-rw-r--r--Userland/Libraries/LibC/stdio_ext.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/stdio.cpp b/Userland/Libraries/LibC/stdio.cpp
index ebbccb3ab5..28486b2cb4 100644
--- a/Userland/Libraries/LibC/stdio.cpp
+++ b/Userland/Libraries/LibC/stdio.cpp
@@ -1328,6 +1328,17 @@ void __fpurge(FILE* stream)
stream->purge();
}
+size_t __freadahead(FILE* stream)
+{
+ VERIFY(stream);
+
+ ScopedFileLock lock(stream);
+
+ size_t available_size;
+ stream->readptr(available_size);
+ return available_size;
+}
+
char const* __freadptr(FILE* stream, size_t* sizep)
{
VERIFY(stream);
diff --git a/Userland/Libraries/LibC/stdio_ext.h b/Userland/Libraries/LibC/stdio_ext.h
index 3dda605f6f..5484ee172f 100644
--- a/Userland/Libraries/LibC/stdio_ext.h
+++ b/Userland/Libraries/LibC/stdio_ext.h
@@ -15,6 +15,7 @@ int __freading(FILE*);
int __fwriting(FILE*);
void __fpurge(FILE*);
+size_t __freadahead(FILE*);
char const* __freadptr(FILE*, size_t*);
__END_DECLS