summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2021-02-20 21:02:07 -0800
committerOri Bernstein <ori@eigenstate.org>2021-02-20 21:02:07 -0800
commit6445a14f639fff32bad4a7523852f8aa85796855 (patch)
treeb25e63586edb98520c1e8199ff5b4afe6d99a6d0
parentf3a05b16ad75acf9fce7ed2f03e141a47dc74d09 (diff)
downloadplan9front-6445a14f639fff32bad4a7523852f8aa85796855.tar.xz
ape/lib9: expose fd2path (thanks phil9)
Fd2path is a useful call for the netsurf plan9 frontend, so we should expose it.
-rw-r--r--sys/include/ape/lib9.h1
-rw-r--r--sys/src/ape/lib/9/fd2path.c9
-rw-r--r--sys/src/ape/lib/9/mkfile1
3 files changed, 11 insertions, 0 deletions
diff --git a/sys/include/ape/lib9.h b/sys/include/ape/lib9.h
index 1d788ea04..43a8ae16a 100644
--- a/sys/include/ape/lib9.h
+++ b/sys/include/ape/lib9.h
@@ -74,5 +74,6 @@ extern unsigned long getfcr(void);
extern unsigned long getfsr(void);
extern void setfcr(unsigned long);
extern void setfsr(unsigned long);
+extern int fd2path(int, char*, int);
#endif
diff --git a/sys/src/ape/lib/9/fd2path.c b/sys/src/ape/lib/9/fd2path.c
new file mode 100644
index 000000000..eb07d0518
--- /dev/null
+++ b/sys/src/ape/lib/9/fd2path.c
@@ -0,0 +1,9 @@
+#include <lib9.h>
+
+extern int _FD2PATH(int, char*, int);
+
+int
+fd2path(int fd, char *buf, int nbuf)
+{
+ return _FD2PATH(fd, buf, nbuf);
+}
diff --git a/sys/src/ape/lib/9/mkfile b/sys/src/ape/lib/9/mkfile
index 9854cf0ac..b7398e2e8 100644
--- a/sys/src/ape/lib/9/mkfile
+++ b/sys/src/ape/lib/9/mkfile
@@ -28,6 +28,7 @@ OFILES=\
u32.$O\
u64.$O\
unmount.$O\
+ fd2path.$O\
</sys/src/cmd/mksyslib