[libcxx-commits] [libcxx] [libc++] Implements filebuf unbuffered. (PR #76629)

Jonathan Wakely via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 5 16:15:10 PST 2024


================
@@ -308,6 +308,43 @@ private:
   state_type __st_;
   state_type __st_last_;
   ios_base::openmode __om_;
+  // There have been no file operations yet, which allows setting unbuffered
+  // I/O mode.
+  static const ios_base::openmode __no_io_operations = ios_base::trunc;
+  // Unbuffered I/O mode has been requested.
+  static const ios_base::openmode __use_unbuffered_io = ios_base::ate;
+  // Used to track the currently used mode and track whether the output should
+  // be unbuffered.
+  // [filebuf.virtuals]/12
+  //   If setbuf(0, 0) is called on a stream before any I/O has occurred on
----------------
jwakely wrote:

The current libstdc++ behaviour is a result of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12875 but I don't think that was the right fix.

https://github.com/llvm/llvm-project/pull/76629


More information about the libcxx-commits mailing list