From 2c8f4d0912a280ae55d73d96d0ca2ed96b8fde8a Mon Sep 17 00:00:00 2001 From: Claes Nästén Date: Thu, 9 Dec 2021 20:01:19 +0100 Subject: fix: add forkpty for SunOS variants forkpty is missing on Solaris < 11 and Illumos, provide fallback implementation for non Solaris 11 users. --- config/CMakeLists.txt | 13 +++++++++++++ config/config.h.in | 1 + 2 files changed, 14 insertions(+) (limited to 'config') diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index 30f08c5297..8f93e1eb27 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -50,6 +50,19 @@ check_function_exists(strcasecmp HAVE_STRCASECMP) check_function_exists(strncasecmp HAVE_STRNCASECMP) check_function_exists(strptime HAVE_STRPTIME) +if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + check_c_source_compiles(" +#include +int +main(void) +{ + return forkpty(0, NULL, NULL, NULL); +} +" HAVE_FORKPTY) +else() + set(HAVE_FORKPTY 1) +endif() + # Symbols check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC) if(HAVE_LANGINFO_H) diff --git a/config/config.h.in b/config/config.h.in index b0635fb52b..b44b7238d2 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -50,6 +50,7 @@ # undef HAVE_SYS_UIO_H # endif #endif +#cmakedefine HAVE_FORKPTY #cmakedefine FEAT_TUI -- cgit