Add terminal width detection to llvm::sys::Process. This is needed to
fix Clang PRs 4148 and 4183.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71448 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 0d61f1e..7e4016f 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -26,6 +26,7 @@
 check_include_file(string.h HAVE_STRING_H)
 check_include_file(sys/dir.h HAVE_SYS_DIR_H)
 check_include_file(sys/dl.h HAVE_SYS_DL_H)
+check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H)
 check_include_file(sys/mman.h HAVE_SYS_MMAN_H)
 check_include_file(sys/ndir.h HAVE_SYS_NDIR_H)
 check_include_file(sys/param.h HAVE_SYS_PARAM_H)
@@ -43,9 +44,11 @@
 
 # function checks
 include(CheckSymbolExists)
+include(CheckFunctionExists)
 check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE)
 check_symbol_exists(getrusage sys/resource.h HAVE_GETRUSAGE)
 check_symbol_exists(setrlimit sys/resource.h HAVE_SETRLIMIT)
+check_function_exists(isatty HAVE_ISATTY)
 check_symbol_exists(isinf cmath HAVE_ISINF_IN_CMATH)
 check_symbol_exists(isinf math.h HAVE_ISINF_IN_MATH_H)
 check_symbol_exists(isnan cmath HAVE_ISNAN_IN_CMATH)