aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term/SunOS.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-03-26 01:59:35 +0000
committerrsc <devnull@localhost>2004-03-26 01:59:35 +0000
commitbe22ae2d0729f68672e3202c91cfe13c9e74cccc (patch)
treeb7bc9f9c1e8d3b221adc82f055f8be19ef25d0e6 /src/cmd/9term/SunOS.c
parent4e3a2cc1f96f4479f951958f9ca1860f57a0771b (diff)
downloadplan9port-be22ae2d0729f68672e3202c91cfe13c9e74cccc.tar.gz
plan9port-be22ae2d0729f68672e3202c91cfe13c9e74cccc.tar.bz2
plan9port-be22ae2d0729f68672e3202c91cfe13c9e74cccc.zip
SunOS can rot in hell.
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;
}