[llvm-commits] CVS: llvm/lib/System/Unix/Process.cpp
Reid Spencer
reid at x10sys.com
Sat Jan 1 14:29:38 PST 2005
Changes in directory llvm/lib/System/Unix:
Process.cpp updated: 1.7 -> 1.8
---
Log message:
Add functions for determining if the stdin/out/err is connected to a
console or not.
---
Diffs of the changes: (+24 -0)
Index: llvm/lib/System/Unix/Process.cpp
diff -u llvm/lib/System/Unix/Process.cpp:1.7 llvm/lib/System/Unix/Process.cpp:1.8
--- llvm/lib/System/Unix/Process.cpp:1.7 Thu Dec 30 23:53:27 2004
+++ llvm/lib/System/Unix/Process.cpp Sat Jan 1 16:29:26 2005
@@ -122,5 +122,29 @@
#endif
}
+bool Process::StandardInIsUserInput() {
+#if HAVE_ISATTY
+ return isatty(0);
+#endif
+ // If we don't have isatty, just return false.
+ return false;
+}
+
+bool Process::StandardOutIsDisplayed() {
+#if HAVE_ISATTY
+ return isatty(1);
+#endif
+ // If we don't have isatty, just return false.
+ return false;
+}
+
+bool Process::StandardErrIsDisplayed() {
+#if HAVE_ISATTY
+ return isatty(2);
+#endif
+ // If we don't have isatty, just return false.
+ return false;
+}
+
}
// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab
More information about the llvm-commits
mailing list