Fix ioctl detection & compilation on OpenSolaris

This commit is contained in:
Moritz Bunkus 2010-03-02 17:56:50 +01:00
parent ed986f4545
commit 6d3db5e80f
2 changed files with 8 additions and 13 deletions

View File

@ -1,14 +1,6 @@
AC_CACHE_CHECK([for ioctl & TIOCGWINSZ], [ac_cv_tiocgwinsz],[
ac_cv_tiocgwinsz="no"
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
#include <sys/ioctl.h>
],[
struct winsize ws;
ioctl(0, TIOCGWINSZ, &ws);
],[ac_cv_tiocgwinsz="yes"])
AC_LANG_POP
])
if test x"$ac_cv_posix_fadvise" = "xyes" ; then
AC_SYS_POSIX_TERMIOS
AC_HEADER_TIOCGWINSZ
if test x"ac_cv_sys_posix_termios" = "xyes" ; then
AC_DEFINE([HAVE_TIOCGWINSZ], 1, [define if ioctl & TIOCGWINSZ are available])
fi

View File

@ -14,7 +14,10 @@
#include "common/os.h"
#if defined(HAVE_TIOCGWINSZ)
# include <sys/ioctl.h>
# include <termios.h>
# if defined(GWINSZ_IN_SYS_IOCTL)
# include <sys/ioctl.h>
# endif // GWINSZ_IN_SYS_IOCTL
#endif // HAVE_TIOCGWINSZ
#include "common/terminal.h"