diff options
author | rsc <devnull@localhost> | 2004-03-25 23:03:57 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-03-25 23:03:57 +0000 |
commit | 8ad517944e46710ab832350c0dc3fc4e9239f7e2 (patch) | |
tree | 7b99a1833e1b303719c2aac75e3f7e82482b42ab /src/cmd/9term/SunOS.c | |
parent | cb27443abf3d6af6ab52377c71c843e619928433 (diff) | |
download | plan9port-8ad517944e46710ab832350c0dc3fc4e9239f7e2.tar.gz plan9port-8ad517944e46710ab832350c0dc3fc4e9239f7e2.tar.bz2 plan9port-8ad517944e46710ab832350c0dc3fc4e9239f7e2.zip |
Today's changes.
More changes.
Diffstat (limited to 'src/cmd/9term/SunOS.c')
-rw-r--r-- | src/cmd/9term/SunOS.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/cmd/9term/SunOS.c b/src/cmd/9term/SunOS.c index 6a37ab33..d7db9fc5 100644 --- a/src/cmd/9term/SunOS.c +++ b/src/cmd/9term/SunOS.c @@ -1,21 +1,6 @@ #include "9term.h" - -int -getchildwd(int pid, char *wdir, int bufn) -{ - char path[256]; - char cwd[256]; - - if(getcwd(cwd, sizeof cwd) < 0) - return -1; - snprint(path, sizeof path, "/proc/%d/cwd", pid); - if(chdir(path) < 0) - return -1; - if(getcwd(wdir, bufn) < 0) - return -1; - chdir(cwd); - return 0; -} +#include <termios.h> +#include <sys/termios.h> int getpts(int fd[], char *slave) @@ -28,3 +13,21 @@ getpts(int fd[], char *slave) fd[0] = open(slave, OREAD); return 0; } + +struct winsize ows; + +void +updatewinsize(int row, int col, int dx, int dy) +{ + struct winsize ws; + + ws.ws_row = row; + ws.ws_col = col; + 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) + fprint(2, "ioctl: %r\n"); + ows = ws; +} + |