mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Add functions for determining if the stdin/out/err is connected to a
console or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19233 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -122,5 +122,29 @@ void Process::PreventCoreFiles() {
|
||||
#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
|
||||
|
@@ -122,5 +122,29 @@ void Process::PreventCoreFiles() {
|
||||
#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
|
||||
|
Reference in New Issue
Block a user