diff -u xterm-orig/main.c xterm/main.c
--- xterm-orig/main.c	Sun May 25 06:07:00 1997
+++ xterm/main.c	Tue Aug 26 20:28:57 1997
@@ -175,8 +175,9 @@
 #define USE_SYSV_UTMP
 #define USE_SYSV_SIGNALS
 #define HAS_UTMP_UT_HOST
-#define LASTLOG
-#define WTMP
+#undef UTMP
+/* #define LASTLOG */
+/* #define WTMP */
 #endif
 
 #ifdef Lynx
@@ -683,6 +684,7 @@
 
 static int inhibit;
 static char passedPty[2];	/* name if pty if slave */
+int ptyhack=-1;
 
 #ifndef AMOEBA
 static int get_pty PROTO((int *pty));
@@ -927,6 +929,7 @@
 { "-C",                    "intercept console messages (not supported)" },
 #endif
 { "-Sxxd",                 "slave mode on \"ttyxx\", file descriptor \"d\"" },
+{ "-Mxxd",                 "master on \"ptyxx\" and file descriptor \"d\"" },
 { NULL, NULL }};
 
 static char *message[] = {
@@ -1444,6 +1447,11 @@
 			   &am_slave) != 3)
 		    Syntax(*argv);
 		continue;
+	     case 'M':
+		if (sscanf(*argv + 2, "%c%c%d", passedPty, passedPty+1, 
+			&ptyhack) != 3)
+			Syntax(*argv);
+		continue;
 #ifdef DEBUG
 	     case 'D':
 		debug = TRUE;
@@ -1697,6 +1705,16 @@
 get_pty (pty)
     int *pty;
 {
+	if (ptyhack!=-1)
+	{
+		if (ptyhack==-2) return 1; /* Avoid loop in handshake code */
+		*pty=ptyhack;
+		sprintf(ptydev, "/dev/pty%c%c", passedPty[0], passedPty[1]);
+		sprintf(ttydev, "/dev/tty%c%c", passedPty[0], passedPty[1]);
+		ptyhack=-2;
+		return 0;
+	}
+
 #ifdef __osf__
     int tty;
     return (openpty(pty, &tty, ttydev, NULL, NULL));

