GNU bug report logs - #12040
24.1.50; `term' hangs on FreeBSD 10.0-CURRENT without pty(4)

Previous Next

Package: emacs;

Reported by: Jan Beich <jbeich <at> tormail.org>

Date: Tue, 24 Jul 2012 02:09:02 UTC

Severity: important

Tags: patch

Found in version 24.1.50

Fixed in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jan Beich <jbeich <at> tormail.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 12040 <at> debbugs.gnu.org, Robert Millan <rmh <at> 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
(cc'ing Robert in case I misread glibc code)

Glenn Morris <rgm <at> 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.




This bug report was last modified 12 years and 341 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.