[libcxx-commits] [libcxx] [libc++][AIX] Support file offsets larger than 2GB in basic_filebuf on 32-bit (PR #215892)

Hubert Tong via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 13 06:31:55 PDT 2026


================
@@ -779,6 +780,15 @@ const wchar_t* basic_filebuf<_CharT, _Traits>::__make_mdwstring(ios_base::openmo
 }
 #    endif
 
+template <class _CharT, class _Traits>
+FILE* basic_filebuf<_CharT, _Traits>::__fopen(const char* __name, const char* __mode) {
+#    if defined(_AIX) && !defined(__64BIT__)
+  return fopen64(__name, __mode);
----------------
hubert-reinterpretcast wrote:

AIX's 32-bit `fopen` won't open files larger than 2 GB. Perhaps a sort of fail-fast or compatibility mechanism.
```
       EOVERFLOW
            The named file is a size larger than 2 Gigabytes.
```

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


More information about the libcxx-commits mailing list