[libc-commits] [libc] [libc] Add printf error handling (PR #162876)
Marcell Leleszi via libc-commits
libc-commits at lists.llvm.org
Fri Oct 17 23:27:29 PDT 2025
================
@@ -47,9 +49,9 @@ LIBC_INLINE void flockfile(::FILE *f) { ::flockfile(f); }
LIBC_INLINE void funlockfile(::FILE *f) { ::funlockfile(f); }
-LIBC_INLINE size_t fwrite_unlocked(const void *ptr, size_t size, size_t nmemb,
- ::FILE *f) {
- return ::fwrite_unlocked(ptr, size, nmemb, f);
+LIBC_INLINE FileIOResult fwrite_unlocked(const void *ptr, size_t size,
+ size_t nmemb, ::FILE *f) {
+ return {::fwrite_unlocked(ptr, size, nmemb, f), errno};
----------------
mleleszi wrote:
Shouldn't we use the system errno in this case? If we are using system file libc_errno won't be set but the system one
https://github.com/llvm/llvm-project/pull/162876
More information about the libc-commits
mailing list