Commit Diff


commit - 8b9aaf2e3f7f6e2733e52db4dd1dcb46a91e4972
commit + 0a7fe606818a7906cdc57ea14cb57b416be6c1de
blob - eec79c286b4360f3f20ac5f3478d7b949e150ddf
blob + 18294803377e437f85addbf427acd8d0ea7e7df5
--- src/cmd/9term/NetBSD.c
+++ src/cmd/9term/NetBSD.c
@@ -1 +1,17 @@
+#define getpts not_using_this_getpts
 #include "bsdpty.c"
+#undef getpts
+
+#include <util.h>
+
+int
+getpts(int fd[], char *slave)
+{
+	if(openpty(&fd[1], &fd[0], NULL, NULL, NULL) >= 0){
+		fchmod(fd[1], 0620);
+		strcpy(slave, ttyname(fd[0]));
+		return 0;
+	}
+	sysfatal("no ptys: %r");
+	return 0;
+}