unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jan Beich <jbeich@tormail.org>
To: Glenn Morris <rgm@gnu.org>
Cc: 12040@debbugs.gnu.org, Robert Millan <rmh@freebsd.org>
Subject: bug#12040: 24.1.50; `term' hangs on FreeBSD 10.0-CURRENT without pty(4)
Date: Thu, 16 Aug 2012 05:10:03 -0500	[thread overview]
Message-ID: <1T1x1j-0005QU-RK@internal.tormail.org> (raw)
In-Reply-To: <1StGrf-000La0-Jk@internal.tormail.org>

(cc'ing Robert in case I misread glibc code)

Glenn Morris <rgm@gnu.org> writes:

> Jan Beich wrote:
>
>> A few ways to solve this:
>> - use openpty() in -lutil like darwin
>> - add use posix_openpt() support
>
> Thanks for the patches.
> Do you (or anyone else) have a feeling for which is the best?

I'd go with less wrappers - posix_openpt(). And also use it on netbsd,
dragonfly and probably darwin.

openpty() is implemented via posix_openpt() in libutil on recent freebsd.

posix_openpt() is a syscall on (k)freebsd. And /dev/ptmx only exists if
pty(4) is loaded, not sure how it affects binaries under linuxulator.

> As written the posix_openpt one changes the behaviour on gnu-linux
> platforms to use posix_openpt instead of getpt.

In glibc/linux case getpt() is implemented via posix_openpt():

  // sysdeps/unix/sysv/linux/getpt.c
  int
  __getpt (void)
  {
    int fd = __posix_openpt (O_RDWR);
    if (fd == -1)
      fd = __bsd_getpt ();
    return fd;
  }

In glibc/kfreebsd case getpt() iterates over /dev/ptyXX which won't work
without pty(4) in kernel.





  parent reply	other threads:[~2012-08-16 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23 11:31 bug#12040: 24.1.50; `term' hangs on FreeBSD 10.0-CURRENT without pty(4) Jan Beich
2012-08-16  6:45 ` Glenn Morris
     [not found] ` <1T1tp3-000F13-AB@internal.tormail.org>
2012-08-16 10:10   ` Jan Beich [this message]
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=1T1x1j-0005QU-RK@internal.tormail.org \
    --to=jbeich@tormail.org \
    --cc=12040@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    --cc=rmh@freebsd.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).