[compiler-rt] [sanitizer] Make internal_close_range available on all POSIX platforms (PR #191971)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 09:30:25 PDT 2026


================
@@ -306,11 +306,14 @@ int internal_madvise(uptr addr, uptr length, int advice) {
   return internal_syscall(SYSCALL(madvise), addr, length, advice);
 }
 
-#    if SANITIZER_FREEBSD
 uptr internal_close_range(fd_t lowfd, fd_t highfd, int flags) {
+#    if SANITIZER_FREEBSD
   return internal_syscall(SYSCALL(close_range), lowfd, highfd, flags);
-}
+#    else
----------------
thurstond wrote:

Nit: place the `#endif` here instead (loosely inspired by https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return).


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


More information about the llvm-commits mailing list