Hi all, A FreeBSD reported that luit does not work properly when omitting the legacy pseudo-terminal from the kernel. This is because luit attempts to open /dev/ptmx, instead of using the POSIX function posix_openpt().
The attached patch should fix this. Best regards, -- Ed Schouten <[email protected]> WWW: http://80386.nl/
From e599ea2515e9eda2d35b72431df5569f2b99f318 Mon Sep 17 00:00:00 2001 From: Ed Schouten <[email protected]> Date: Wed, 12 Oct 2011 20:53:21 +0200 Subject: [PATCH] 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. --- configure.ac | 2 +- sys.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index c3cd947..e9a5984 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) AC_ARG_WITH(localealiasfile, AS_HELP_STRING([--with-localealiasfile=<path>], diff --git a/sys.c b/sys.c index 804bdbb..8463b05 100644 --- a/sys.c +++ b/sys.c @@ -335,7 +335,11 @@ allocatePty(int *pty_return, char **line_return) #if defined(HAVE_GRANTPT) int rc; +#ifdef HAVE_POSIX_OPENPT + pty = posix_openpt(O_RDWR); +#else pty = open("/dev/ptmx", O_RDWR); +#endif if (pty < 0) goto bsd; -- 1.7.7
pgpt2F3s6lF9D.pgp
Description: PGP signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
