From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan Beich Newsgroups: gmane.emacs.bugs 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 Message-ID: <1StGrf-000La0-Jk@internal.tormail.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1343095354 24935 80.91.229.3 (24 Jul 2012 02:02:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 Jul 2012 02:02:34 +0000 (UTC) To: 12040@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 24 04:02:34 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1StUSE-0001U9-OJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Jul 2012 04:02:30 +0200 Original-Received: from localhost ([::1]:35513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StUSE-0007P7-4p for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jul 2012 22:02:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StUSB-0007Ok-P6 for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 22:02:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StUSA-0007RJ-3b for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 22:02:27 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StUS9-0007Qd-Vc for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 22:02:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1StUYY-0006oq-M4 for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 22:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jan Beich Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Jul 2012 02:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12040 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134309572826144 (code B ref -1); Tue, 24 Jul 2012 02:09:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Jul 2012 02:08:48 +0000 Original-Received: from localhost ([127.0.0.1]:34300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1StUYJ-0006na-PE for submit@debbugs.gnu.org; Mon, 23 Jul 2012 22:08:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51371) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1StUYH-0006nN-Nl for submit@debbugs.gnu.org; Mon, 23 Jul 2012 22:08:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StURr-0007LS-Hi for submit@debbugs.gnu.org; Mon, 23 Jul 2012 22:02:08 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:45051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StURr-0007LO-Et for submit@debbugs.gnu.org; Mon, 23 Jul 2012 22:02:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StURq-0007MJ-4u for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 22:02:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StURo-0007KM-Bh for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 22:02:06 -0400 Original-Received: from server2.allsitecontrol.com ([63.143.36.210]:53207) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StURo-0007Ho-2h for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 22:02:04 -0400 Original-Received: from wau.torservers.net ([109.163.233.200]:55115 helo=internal.tormail.org) by server2.allsitecontrol.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.77) (envelope-from ) id 1StURa-002vIh-N3 for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 22:01:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tormail.org; s=tm; h=Message-Id:X-TorMail-User:Content-Type:MIME-Version:Date:Subject:To:From; bh=tsGX+x1fTPOlfqB+JXkk4YjBjm8JgPZ7wHOSLgHBdKY=; b=i5BxH/SXVXw2HgDtA1giefxo80zC7La1mFy1K1+5DYdaKRR73L1Ey947j/MBCaLUQhfeChKu3HERT8eCBy/+XPinpsGhHkIt3pKCwiyCQWDUGtAJ32IRXuIe/wg7dMXlvUgKgrgbUBKr4iNOP0oKz+QmxInW8QgXKhpXSrkRC9k=; Original-Received: from jbeich by internal.tormail.org with local (Exim 4.63) (envelope-from ) id 1StGrf-000La0-Jk for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 11:31:53 +0000 X-TorMail-User: jbeich X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server2.allsitecontrol.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tormail.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:62337 Archived-At: --=-=-= Content-Type: text/plain 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 $ 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=openpty.diff === 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 ]], [[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 #endif +#ifdef HAVE_LIBUTIL_H +#include +#endif + #ifdef HAVE_PTY_H #include #endif --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=posix_openpt.diff === 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 --=-=-=--