Jeremy Soller 6 years ago
parent
commit
632f9f18e5
2 changed files with 8 additions and 1 deletions
  1. 1 1
      core_io
  2. 7 0
      src/header/stdio/mod.rs

+ 1 - 1
core_io

@@ -1 +1 @@
-Subproject commit eb7204830786d7cbb776c6a878c7a59569840484
+Subproject commit a4ddc38063ddb2f2ff1b17f772b8b50f7f3baecd

+ 7 - 0
src/header/stdio/mod.rs

@@ -390,6 +390,13 @@ pub extern "C" fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FI
     }
 }
 
+#[no_mangle]
+pub extern "C" fn __fpending(stream: *mut FILE) -> size_t {
+    let mut stream = unsafe { &mut *stream }.lock();
+
+    stream.writer.inner.buf.len() as size_t
+}
+
 /// Insert a character into the stream
 #[no_mangle]
 pub extern "C" fn fputc(c: c_int, stream: *mut FILE) -> c_int {