From: Jan Beich <jbeich@tormail.org>
To: 12040@debbugs.gnu.org
Subject: bug#12040: 24.1.50; `term' hangs on FreeBSD 10.0-CURRENT without pty(4)
Date: Mon, 23 Jul 2012 23:31:27 +1200 [thread overview]
Message-ID: <1StGrf-000La0-Jk@internal.tormail.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 567 bytes --]
Starting with FreeBSD 8.0-RELEASE the system uses new tty layer that no
longer supports old style pseudo ttys *unless* pty(4) kernel module is
loaded. However, pty(4) device is still included in GENERIC kernel on
all releases except 10.0-CURRENT (removed in r233271).
$ emacs -Q
M-x term
<hangs here>
$ sudo kldload pty
[try again]
A few ways to solve this:
- use openpty() in -lutil like darwin
- add use posix_openpt() support
http://svn.freebsd.org/changeset/base/233271
https://pub.allbsd.org/FreeBSD-snapshots/ # for testing, seems to be down atm
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: openpty.diff --]
[-- Type: text/x-patch, Size: 1233 bytes --]
=== modified file 'configure.ac'
--- configure.ac 2012-07-17 07:30:25 +0000
+++ configure.ac 2012-07-21 09:10:00 +0000
@@ -1220,7 +1220,7 @@
linux/version.h sys/systeminfo.h
stdio_ext.h fcntl.h coff.h pty.h
sys/vlimit.h sys/resource.h
- sys/utsname.h pwd.h utmp.h dirent.h util.h)
+ sys/utsname.h pwd.h utmp.h dirent.h util.h libutil.h)
AC_MSG_CHECKING(if personality LINUX32 can be set)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/personality.h>]], [[personality (PER_LINUX32)]])],
@@ -3344,7 +3344,7 @@
AC_DEFINE(PTY_TTY_NAME_SPRINTF, [] )
;;
- darwin )
+ darwin | freebsd )
AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)] )
dnl Not used, because PTY_ITERATION is defined.
AC_DEFINE(FIRST_PTY_LETTER, ['p'])
@@ -3356,7 +3356,7 @@
AC_DEFINE(PTY_TTY_NAME_SPRINTF, [] )
;;
- gnu | freebsd | netbsd | openbsd )
+ gnu | netbsd | openbsd )
AC_DEFINE(FIRST_PTY_LETTER, ['p'])
;;
=== modified file 'src/process.c'
--- src/process.c 2012-07-20 07:29:04 +0000
+++ src/process.c 2012-07-21 09:10:00 +0000
@@ -83,6 +83,10 @@
#include <util.h>
#endif
+#ifdef HAVE_LIBUTIL_H
+#include <libutil.h>
+#endif
+
#ifdef HAVE_PTY_H
#include <pty.h>
#endif
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: posix_openpt.diff --]
[-- Type: text/x-patch, Size: 1722 bytes --]
=== 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
next reply other threads:[~2012-07-23 11:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-23 11:31 Jan Beich [this message]
2012-08-16 6:45 ` bug#12040: 24.1.50; `term' hangs on FreeBSD 10.0-CURRENT without pty(4) Glenn Morris
[not found] ` <1T1tp3-000F13-AB@internal.tormail.org>
2012-08-16 10:10 ` Jan Beich
2012-08-17 7:21 ` Glenn Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1StGrf-000La0-Jk@internal.tormail.org \
--to=jbeich@tormail.org \
--cc=12040@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).