aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_util.h
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2002-09-01 21:15:37 +0000
committerIan Dowse <iedowse@FreeBSD.org>2002-09-01 21:15:37 +0000
commitff7663218920232f9a9f8cb5d69a4941bdf9d066 (patch)
tree34bd9f42149c266a29158d0370095f104a0b9600 /sys/compat/linux/linux_util.h
parented7ada7c1086f538478775846edf6d0de6d88bc1 (diff)
Notes
Diffstat (limited to 'sys/compat/linux/linux_util.h')
-rw-r--r--sys/compat/linux/linux_util.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h
index ee421a2927c24..7f69ad5547f93 100644
--- a/sys/compat/linux/linux_util.h
+++ b/sys/compat/linux/linux_util.h
@@ -46,6 +46,7 @@
#include <sys/exec.h>
#include <sys/sysent.h>
#include <sys/cdefs.h>
+#include <sys/uio.h>
static __inline caddr_t stackgap_init(void);
static __inline void *stackgap_alloc(caddr_t *, size_t);
@@ -74,6 +75,7 @@ stackgap_alloc(sgp, sz)
extern const char linux_emul_path[];
+int linux_emul_convpath(struct thread *, char *, enum uio_seg, char **, int);
int linux_emul_find(struct thread *, caddr_t *, char *, char **, int);
#define CHECKALT(p, sgp, path, i) \
@@ -88,6 +90,20 @@ int linux_emul_find(struct thread *, caddr_t *, char *, char **, int);
#define CHECKALTEXIST(p, sgp, path) CHECKALT(p, sgp, path, 0)
#define CHECKALTCREAT(p, sgp, path) CHECKALT(p, sgp, path, 1)
+#define LCONVPATH(td, upath, pathp, i) \
+ do { \
+ int _error; \
+ \
+ _error = linux_emul_convpath(td, upath, UIO_USERSPACE, \
+ pathp, i); \
+ if (*(pathp) == NULL) \
+ return (_error); \
+ } while (0)
+
+#define LCONVPATHEXIST(td, upath, pathp) LCONVPATH(td, upath, pathp, 0)
+#define LCONVPATHCREAT(td, upath, pathp) LCONVPATH(td, upath, pathp, 1)
+#define LFREEPATH(path) free(path, M_TEMP)
+
#define DUMMY(s) \
int \
linux_ ## s(struct thread *p, struct linux_ ## s ## _args *args) \