=== modified file 'configure.ac' --- configure.ac 2012-07-17 07:30:25 +0000 +++ configure.ac 2012-07-23 10:52:48 +0000 @@ -2759,7 +2759,7 @@ AC_CHECK_FUNCS(grantpt) # PTY-related GNU extensions. -AC_CHECK_FUNCS(getpt) +AC_CHECK_FUNCS(getpt posix_openpt) # Check this now, so that we will NOT find the above functions in ncurses. # That is because we have not set up to link ncurses in lib-src. @@ -3356,11 +3356,11 @@ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [] ) ;; - gnu | freebsd | netbsd | openbsd ) + gnu | netbsd | openbsd ) AC_DEFINE(FIRST_PTY_LETTER, ['p']) ;; - gnu-linux | gnu-kfreebsd ) + gnu-linux | gnu-kfreebsd | freebsd ) dnl if HAVE_GRANTPT if test "x$ac_cv_func_grantpt" = xyes; then AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.]) @@ -3368,8 +3368,12 @@ dnl Note that grantpt and unlockpt may fork. We must block SIGCHLD dnl to prevent sigchld_handler from intercepting the child's death. AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); sigunblock (sigmask (SIGCHLD)); }] ) + dnl if HAVE_POSIX_OPENPT + if test "x$ac_cv_func_posix_openpt" = xyes; then + AC_DEFINE(PTY_OPEN, [fd = posix_openpt (O_RDWR | O_NOCTTY)]) + AC_DEFINE(PTY_NAME_SPRINTF, [] ) dnl if HAVE_GETPT - if test "x$ac_cv_func_getpt" = xyes; then + elif test "x$ac_cv_func_getpt" = xyes; then AC_DEFINE(PTY_OPEN, [fd = getpt ()]) AC_DEFINE(PTY_NAME_SPRINTF, [] ) else