patch-ab is only an unintrusive short-term fix, discussion with the authors
how to fix it correctly has started.
NetBSD >= 3.0 supports grantpt() but it invalidates the slave
FD (see grantpt(3) on NetBSD) obtained through openpty() so we discard
the (now invalid) descriptor for the slave tty. This causes Tty.xs to open
the slave tty again.
The issue should be really fixed by using posix_openpt() instead of
openpty(). The functions posix_openpt(), grantpt(), unlockpt()
and ptsname() belong together and should be used ahead of
all the other ways to create the master and slave tty, not just
on NetBSD. See also
http://www.opengroup.org/onlinepubs/009695399/functions/posix_openpt.html
additions to the API and a complete rewrite of the way a pty is allocated,
and the use of openpty() in *BSD to open the allocated pty, and other bug
fixes.
We had to fix Makefile.PL to correctly invoke the preprocessor. The changes
have been forwarded to the author.
This closes pkg/15896 by Shell Hung <shell@shellhung.org>.