summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4/svr4_util.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-02-07 21:53:42 +0000
committerjhb <jhb@FreeBSD.org>2005-02-07 21:53:42 +0000
commitb03a8bb21b2ea1fa1d440565c2ee55a7391e1c18 (patch)
treeefd3135666f0a3a86a501aeec1a200d171da8119 /sys/compat/svr4/svr4_util.h
parent60bd53b164c6f3ebe8ff23d8c89209d883ddbb7a (diff)
downloadFreeBSD-src-b03a8bb21b2ea1fa1d440565c2ee55a7391e1c18.zip
FreeBSD-src-b03a8bb21b2ea1fa1d440565c2ee55a7391e1c18.tar.gz
- Implement svr4_emul_find() using kern_alternate_path(). This changes
the semantics in that the returned filename to use is now a kernel pointer rather than a user space pointer. This required changing the arguments to the CHECKALT*() macros some and changing the various system calls that used pathnames to use the kern_foo() functions that can accept kernel space filename pointers instead of calling the system call directly. - Use kern_open(), kern_access(), kern_msgctl(), kern_execve(), kern_mkfifo(), kern_mknod(), kern_statfs(), kern_fstatfs(), kern_setitimer(), kern_stat(), kern_lstat(), kern_fstat(), kern_utimes(), kern_pathconf(), and kern_unlink().
Diffstat (limited to 'sys/compat/svr4/svr4_util.h')
-rw-r--r--sys/compat/svr4/svr4_util.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/compat/svr4/svr4_util.h b/sys/compat/svr4/svr4_util.h
index dc12237..66902dd 100644
--- a/sys/compat/svr4/svr4_util.h
+++ b/sys/compat/svr4/svr4_util.h
@@ -39,6 +39,7 @@
#include <sys/exec.h>
#include <sys/sysent.h>
#include <sys/cdefs.h>
+#include <sys/uio.h>
#ifdef DEBUG_SVR4
#define DPRINTF(a) uprintf a;
@@ -70,21 +71,18 @@ stackgap_alloc(sgp, sz)
return p;
}
-extern const char svr4_emul_path[];
-int svr4_emul_find(struct thread *, caddr_t *, const char *, char *,
- char **, int);
+int svr4_emul_find(struct thread *, char *, enum uio_seg, char **, int);
-#define CHECKALT(p, sgp, path, i) \
+#define CHECKALT(td, upath, pathp, i) \
do { \
int _error; \
\
- _error = svr4_emul_find(p, sgp, svr4_emul_path, path, \
- &path, i); \
- if (_error == EFAULT) \
+ _error = svr4_emul_find(td, upath, UIO_USERSPACE, pathp, i); \
+ if (*(pathp) == NULL) \
return (_error); \
} while (0)
-#define CHECKALTEXIST(p, sgp, path) CHECKALT(p, sgp, path, 0)
-#define CHECKALTCREAT(p, sgp, path) CHECKALT(p, sgp, path, 1)
+#define CHECKALTEXIST(td, upath, pathp) CHECKALT(td, upath, pathp, 0)
+#define CHECKALTCREAT(td, upath, pathp) CHECKALT(td, upath, pathp, 1)
#endif /* !_SVR4_UTIL_H_ */
OpenPOWER on IntegriCloud