[libcxx-commits] [libcxx] [AIX][libc++] fopen() does not support the 'x' (exclusive/noreplace) mode suffix. (PR #206498)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jul 13 02:51:23 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)
----------------
philnik777 wrote:
Why do we need to handle this in libc++? If `fopen` was conforming it would fail and this code wouldn't need to be modified in order to be conforming. We would simply fail gracefully. What am I missing?
https://github.com/llvm/llvm-project/pull/206498
More information about the libcxx-commits
mailing list