summaryrefslogtreecommitdiffstats
path: root/src/cmd/9term/SunOS.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/9term/SunOS.c')
-rw-r--r--src/cmd/9term/SunOS.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/cmd/9term/SunOS.c b/src/cmd/9term/SunOS.c
index d7db9fc5..d9104ed7 100644
--- a/src/cmd/9term/SunOS.c
+++ b/src/cmd/9term/SunOS.c
@@ -1,6 +1,8 @@
-#include "9term.h"
+#include <u.h>
#include <termios.h>
#include <sys/termios.h>
+#include <libc.h>
+#include "term.h"
int
getpts(int fd[], char *slave)
@@ -14,6 +16,19 @@ getpts(int fd[], char *slave)
return 0;
}
+int
+childpty(int fd[], char *slave)
+{
+ int sfd;
+
+ close(fd[1]);
+ setsid();
+ sfd = open(slave, ORDWR);
+ if(sfd < 0)
+ sysfatal("open %s: %r\n", slave);
+ return sfd;
+}
+
struct winsize ows;
void
@@ -26,7 +41,7 @@ updatewinsize(int row, int col, int dx, int dy)
ws.ws_xpixel = dx;
ws.ws_ypixel = dy;
if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col)
- if(ioctl(rcfd[0], TIOCSWINSZ, &ws) < 0)
+ if(ioctl(rcfd, TIOCSWINSZ, &ws) < 0)
fprint(2, "ioctl: %r\n");
ows = ws;
}