[libcxx-commits] [libcxx] [AIX][libc++] fopen() does not support the 'x' (exclusive/noreplace) mode suffix. (PR #206498)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 13 07:09:04 PDT 2026


================
@@ -664,6 +674,9 @@ const char* basic_filebuf<_CharT, _Traits>::__make_mdstring(ios_base::openmode _
   case ios_base::in | ios_base::app | ios_base::binary:
     return "a+b" _LIBCPP_FOPEN_CLOEXEC_MODE;
 #    if _LIBCPP_STD_VER >= 23
+// AIX fopen() does not support the 'x' (noreplace) mode suffix; these cases fall through to
+// default (return nullptr), which is conformant per C23 7.21.5.3p5 (fail if atomic check-and-create is unsupported).
+#      if !defined(_AIX)
----------------
Himadhith wrote:

Ideally we would want the fix to be in the libc side of things, but this defect has been an open CMVC defect for years now. We are looking into a long term solution after this workaround. 

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


More information about the libcxx-commits mailing list