@@ -0,0 +1,29 @@
+Index: erts/etc/unix/run_erl.c
+===================================================================
+--- erts/etc/unix/run_erl.c.orig
++++ erts/etc/unix/run_erl.c
+@@ -43,6 +43,8 @@
+ #include <dirent.h>
+ #include <termios.h>
+ #include <time.h>
++#include <pty.h>
++#include <utmp.h>
+ #if !defined(NO_SYSLOG)
+ #include <syslog.h>
+ #endif
+@@ -887,6 +889,15 @@ static int open_pty_master(char **ptysla
+ /* http://www.xcf.berkeley.edu/~ali/K0D/UNIX/PTY/code/upty.h.html */
+
+ {
++ static char ttyname[] = " ";
++ if (0 == openpty(&mfd, &sfd, ttyname, NULL, NULL)) {
++ close(sfd);
++ *ptyslave = ttyname;
++ return mfd;
++ }
++ }
++
++ {
+ /* New style devpts or devfs /dev/pty/{m,s}{0,1....} */
+
+ static char ptyname[] = "/dev/pty/mX";
|