aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-12-27 00:38:00 +0000
committerrsc <devnull@localhost>2004-12-27 00:38:00 +0000
commit3694b738b883dec5b93f11d4025541af5f713482 (patch)
tree31ef361cc129e942d1af767237dc8943db7abfa8 /src
parent2b9172c7d4f8f3f773946e1aab4f9376f50b4cf7 (diff)
downloadplan9port-3694b738b883dec5b93f11d4025541af5f713482.tar.gz
plan9port-3694b738b883dec5b93f11d4025541af5f713482.tar.bz2
plan9port-3694b738b883dec5b93f11d4025541af5f713482.zip
handle pty correctly on linux
Diffstat (limited to 'src')
-rw-r--r--src/cmd/9term/Linux.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cmd/9term/Linux.c b/src/cmd/9term/Linux.c
index eec79c28..a9bf6f9a 100644
--- a/src/cmd/9term/Linux.c
+++ b/src/cmd/9term/Linux.c
@@ -1 +1,15 @@
+#define getpts not_using_this_getpts
#include "bsdpty.c"
+#undef getpts
+
+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");
+ return 0;
+}