]> git.lizzy.rs Git - plan9front.git/commitdiff
ape/lib9: expose fd2path (thanks phil9)
authorOri Bernstein <ori@eigenstate.org>
Sun, 21 Feb 2021 05:02:07 +0000 (21:02 -0800)
committerOri Bernstein <ori@eigenstate.org>
Sun, 21 Feb 2021 05:02:07 +0000 (21:02 -0800)
Fd2path is a useful call for the netsurf plan9 frontend,
so we should expose it.

sys/include/ape/lib9.h
sys/src/ape/lib/9/fd2path.c [new file with mode: 0644]
sys/src/ape/lib/9/mkfile

index 1d788ea04798dde2830d640399ca7362349bf2fe..43a8ae16a5637afe8d4f4df744f83f7fc30c071b 100644 (file)
@@ -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 (file)
index 0000000..eb07d05
--- /dev/null
@@ -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);
+}
index 9854cf0ac9cfdba47f359fb4b5a061a5aa5b3216..b7398e2e8531a428f73e2daade95fc3fd81b96be 100644 (file)
@@ -28,6 +28,7 @@ OFILES=\
        u32.$O\
        u64.$O\
        unmount.$O\
+       fd2path.$O\
 
 </sys/src/cmd/mksyslib