From 6445a14f639fff32bad4a7523852f8aa85796855 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Sat, 20 Feb 2021 21:02:07 -0800 Subject: [PATCH] ape/lib9: expose fd2path (thanks phil9) Fd2path is a useful call for the netsurf plan9 frontend, so we should expose it. --- sys/include/ape/lib9.h | 1 + sys/src/ape/lib/9/fd2path.c | 9 +++++++++ sys/src/ape/lib/9/mkfile | 1 + 3 files changed, 11 insertions(+) create mode 100644 sys/src/ape/lib/9/fd2path.c 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 + +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\