aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term/Linux.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2003-11-23 18:02:15 +0000
committerrsc <devnull@localhost>2003-11-23 18:02:15 +0000
commitcfabc3ed1638efc186ebd26bdaa3dfb5663dff17 (patch)
tree90628d7263b49fdc5e526bfda8efbe784e05fdc1 /src/cmd/9term/Linux.c
parentb8c14089d8f4be73a908f82f62fce80ed2c14a8d (diff)
Dhog's 9term.
Updated for current libraries by Caerwyn Jones. Button-3 plumbing (like in acme) by rsc.
Diffstat (limited to 'src/cmd/9term/Linux.c')
-rw-r--r--src/cmd/9term/Linux.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cmd/9term/Linux.c b/src/cmd/9term/Linux.c
new file mode 100644
index 00000000..7cdb513e
--- /dev/null
+++ b/src/cmd/9term/Linux.c
@@ -0,0 +1,22 @@
+#include "9term.h"
+
+void
+pdx(int pid, char *wdir, int bufn)
+{
+ char path[256];
+ int n;
+
+ snprint(path, sizeof path, "/proc/%d/cwd", pid);
+ n = readlink(path, wdir, bufn);
+ if(n < 0)
+ n = 0;
+ wdir[n] = '\0';
+}
+
+int
+getpts(int fd[], char *slave)
+{
+
+ openpty(&fd[1], &fd[0], slave, 0, 0);
+ return 0;
+}