aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term
diff options
context:
space:
mode:
authorNicola Girardi <nicola@aloc.in>2020-03-20 18:52:41 +0000
committerRuss Cox <rsc@swtch.com>2020-12-30 07:53:28 -0500
commit0a7fe606818a7906cdc57ea14cb57b416be6c1de (patch)
tree33c5d96318c8635f5fcb2ff6b2e65083eddc80be /src/cmd/9term
parent8b9aaf2e3f7f6e2733e52db4dd1dcb46a91e4972 (diff)
downloadplan9port-0a7fe606818a7906cdc57ea14cb57b416be6c1de.tar.gz
plan9port-0a7fe606818a7906cdc57ea14cb57b416be6c1de.tar.bz2
plan9port-0a7fe606818a7906cdc57ea14cb57b416be6c1de.zip
9term: use openpty on NetBSD
Fixes #376.
Diffstat (limited to 'src/cmd/9term')
-rw-r--r--src/cmd/9term/NetBSD.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cmd/9term/NetBSD.c b/src/cmd/9term/NetBSD.c
index eec79c28..18294803 100644
--- a/src/cmd/9term/NetBSD.c
+++ b/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;
+}