928fb3
--- otp_src_R10B-10/erts/etc/unix/run_erl.c.bak	2006-05-03 15:54:19.000000000 +0200
928fb3
+++ otp_src_R10B-10/erts/etc/unix/run_erl.c	2006-05-03 15:57:36.000000000 +0200
928fb3
@@ -42,6 +42,8 @@
928fb3
 #include <dirent.h>
928fb3
 #include <termios.h>
928fb3
 #include <time.h>
928fb3
+#include <pty.h>
928fb3
+#include <utmp.h>
928fb3
 #if !defined(NO_SYSLOG)
928fb3
 #include <syslog.h>
928fb3
 #endif
928fb3
@@ -803,6 +805,7 @@
928fb3
 static int open_pty_master(char **ptyslave)
928fb3
 {
928fb3
   int mfd;
928fb3
+  int sfd;
928fb3
   char *major, *minor;
928fb3
 
928fb3
   static char majorchars[] = "pqrstuvwxyzabcdePQRSTUVWXYZABCDE";
928fb3
@@ -818,6 +821,15 @@
928fb3
   /* http://www.xcf.berkeley.edu/~ali/K0D/UNIX/PTY/code/upty.h.html */
928fb3
 
928fb3
   {
928fb3
+    static char ttyname[] = "                                   ";
928fb3
+    if (0 == openpty(&mfd, &sfd, ttyname, NULL, NULL)) {
928fb3
+      close(sfd);
928fb3
+      *ptyslave = ttyname;
928fb3
+      return mfd;
928fb3
+    }
928fb3
+  }
928fb3
+
928fb3
+  {
928fb3
     /* New style devpts or devfs /dev/pty/{m,s}{0,1....} */
928fb3
 
928fb3
     static char ptyname[] = "/dev/pty/mX";
928fb3
--- otp_src_R10B-10/erts/etc/common/Makefile.in.orig	2006-05-03 17:08:53.000000000 +0200
928fb3
+++ otp_src_R10B-10/erts/etc/common/Makefile.in	2006-05-03 17:10:18.000000000 +0200
928fb3
@@ -241,7 +241,7 @@
928fb3
 	$(PURIFY) $(LD) $(LDFLAGS) $(ENTRY_LDFLAGS) -o $@ $(OBJDIR)/inet_gethost.o $(ENTRY_OBJ) $(LIBS) 
928fb3
 
928fb3
 $(BINDIR)/run_erl: $(OBJDIR)/run_erl.o
928fb3
-	$(LD) $(LDFLAGS) -o $@ $(OBJDIR)/run_erl.o
928fb3
+	$(LD) $(LDFLAGS) -lutil -o $@ $(OBJDIR)/run_erl.o
928fb3
 
928fb3
 $(OBJDIR)/run_erl.o: ../unix/run_erl.c
928fb3
 	$(CC) $(CFLAGS) -o $@ -c ../unix/run_erl.c