Simon Josefsson wrote: > HAVE_OPENPTY is not set in config.h though -- isn't that a bug? The > system has openpty. > ... > Single stepping rpl_openpty: > > master = open ("/dev/ptmx", O_RDWR | O_NOCTTY); > if (master < 0) > => return -1; > > And indeed my Mac OS X system doesn't have /dev/ptmx:
In the case the system does not have /dev/ptmx and has an openpty function, the safest approach is to use that functions - we don't know which device files it may try. But this works only if HAVE_OPENPTY is defined, and - you're right - the problem is that it does not get defined. This should fix it: 2010-04-15 Bruno Haible <br...@clisp.org> openpty: Fix mistake from 2010-03-21. * m4/pty.m4 (gl_FUNC_OPENPTY): Define HAVE_OPENPTY when openpty exists. Reported by Simon Josefsson. --- m4/pty.m4.orig Fri Apr 16 02:37:59 2010 +++ m4/pty.m4 Fri Apr 16 02:37:57 2010 @@ -1,4 +1,4 @@ -# pty.m4 serial 6 +# pty.m4 serial 7 dnl Copyright (C) 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -119,6 +119,8 @@ if test $gl_cv_func_openpty_const != yes; then REPLACE_OPENPTY=1 AC_LIBOBJ([openpty]) + AC_DEFINE([HAVE_OPENPTY], [1], + [Define to 1 if the system has the 'openpty' function.]) fi else dnl The system does not have openpty.