[llvm] [LLVM] [Support] Disable `ioctl()` terminal size check on Solaris (PR #144600)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 13:43:38 PDT 2025


https://github.com/Sirraide created https://github.com/llvm/llvm-project/pull/144600

#143514 broke the `clang-solaris11-sparcv9` bot; from what I can tell that’s Solaris and according to `SolarisTargetInfo::getOSDefines`, the macro `__sun__` should be defined on Solaris, so check for that and don’t try to query the terminal size if it is defined.

Not sure this is the best solution but hopefully it fixes the bot.

>From 6aeba8f0c0f6f1da617b47a74ff81d8bf1b921f8 Mon Sep 17 00:00:00 2001
From: Sirraide <aeternalmail at gmail.com>
Date: Tue, 17 Jun 2025 22:41:07 +0200
Subject: [PATCH] [LLVM] [Support] Disable terminal size check on Solaris

---
 llvm/lib/Support/Unix/Process.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc
index db735b7484ad8..c6e79af44b9b4 100644
--- a/llvm/lib/Support/Unix/Process.inc
+++ b/llvm/lib/Support/Unix/Process.inc
@@ -320,7 +320,7 @@ static unsigned getColumns(int FileID) {
   // instead if it isn't available.
   unsigned Columns = 0;
 
-#ifdef HAVE_SYS_IOCTL_H
+#if defined(HAVE_SYS_IOCTL_H) && !defined(__sun__)
   struct winsize ws;
   if (ioctl(FileID, TIOCGWINSZ, &ws) == 0)
     Columns = ws.ws_col;



More information about the llvm-commits mailing list