Commit 525785fd authored by Ed Schouten's avatar Ed Schouten Committed by Alan Coopersmith

Add support for posix_openpt().

Instead of opening /dev/ptmx directly, we should use the proper
posix_openpt() function to obtain a pseudo-terminal. Some operating
systems, such as FreeBSD 8 and later, implement pseudo-terminal master
device nodes as a special file descriptor type, like sockets. They do
not support creation of pseudo-terminals through /dev/ptmx.
Signed-off-by: default avatarEd Schouten <>
Reviewed-by: Guillem Jover's avatarGuillem Jover <>
Reviewed-by: Alan Coopersmith's avatarAlan Coopersmith <>
Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <>
parent 82bec8b8
......@@ -38,7 +38,7 @@ AC_CANONICAL_HOST
AC_CHECK_HEADERS([pty.h stropts.h sys/param.h sys/select.h])
AC_CHECK_FUNCS([select grantpt])
AC_CHECK_FUNCS([select grantpt posix_openpt])
......@@ -335,7 +335,11 @@ allocatePty(int *pty_return, char **line_return)
#if defined(HAVE_GRANTPT)
int rc;
pty = posix_openpt(O_RDWR);
pty = open("/dev/ptmx", O_RDWR);
if (pty < 0)
goto bsd;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment