shithub: plan9front

Download patch

ref: 6445a14f639fff32bad4a7523852f8aa85796855
parent: f3a05b16ad75acf9fce7ed2f03e141a47dc74d09
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Feb 21 00:02:07 EST 2021

ape/lib9: expose fd2path (thanks phil9)

Fd2path is a useful call for the netsurf plan9 frontend,
so we should expose it.

--- a/sys/include/ape/lib9.h
+++ b/sys/include/ape/lib9.h
@@ -74,5 +74,6 @@
 extern	unsigned long	getfsr(void);
 extern	void		setfcr(unsigned long);
 extern	void		setfsr(unsigned long);
+extern	int 	fd2path(int, char*, int);
 
 #endif
--- /dev/null
+++ b/sys/src/ape/lib/9/fd2path.c
@@ -1,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);
+}
--- a/sys/src/ape/lib/9/mkfile
+++ b/sys/src/ape/lib/9/mkfile
@@ -28,6 +28,7 @@
 	u32.$O\
 	u64.$O\
 	unmount.$O\
+	fd2path.$O\
 
 </sys/src/cmd/mksyslib