diff options
author | jhb <jhb@FreeBSD.org> | 2005-02-07 22:02:18 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-02-07 22:02:18 +0000 |
commit | 4a479b242427dd7291f1456f605ae37513c1ceaf (patch) | |
tree | 5d16fdc572b765e011ca89f203e7653f1ba5a0a8 /sys/i386/ibcs2/ibcs2_util.h | |
parent | b03a8bb21b2ea1fa1d440565c2ee55a7391e1c18 (diff) | |
download | FreeBSD-src-4a479b242427dd7291f1456f605ae37513c1ceaf.zip FreeBSD-src-4a479b242427dd7291f1456f605ae37513c1ceaf.tar.gz |
- Implement ibcs2_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_execve(), kern_mkfifo(), kern_mknod(),
kern_setitimer(), kern_getrusage(), kern_utimes(), kern_unlink(),
kern_chdir(), kern_chmod(), kern_chown(), kern_symlink(), kern_readlink(),
kern_select(), kern_statfs(), kern_fstatfs(), kern_stat(), kern_lstat(),
kern_fstat().
- Drop the unused 'uap' argument from spx_open().
- Replace a stale duplication of vn_access() in xenix_access() lacking
recent additions such as MAC checks, etc. with a call to kern_access().
Diffstat (limited to 'sys/i386/ibcs2/ibcs2_util.h')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_util.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/i386/ibcs2/ibcs2_util.h b/sys/i386/ibcs2/ibcs2_util.h index 8c6ae3d..bf2513e 100644 --- a/sys/i386/ibcs2/ibcs2_util.h +++ b/sys/i386/ibcs2/ibcs2_util.h @@ -50,6 +50,7 @@ #include <sys/exec.h> #include <sys/sysent.h> #include <sys/proc.h> +#include <sys/uio.h> static __inline caddr_t stackgap_init(void); static __inline void *stackgap_alloc(caddr_t *, size_t); @@ -82,17 +83,22 @@ stackgap_alloc(sgp, sz) extern const char ibcs2_emul_path[]; -int ibcs2_emul_find(struct thread *, caddr_t *, const char *, char *, - char **, int); +int ibcs2_emul_find(struct thread *, char *, enum uio_seg, char **, int); -#define CHECKALTEXIST(p, sgp, path) \ - ibcs2_emul_find(td, sgp, ibcs2_emul_path, path, &(path), 0) +#define CHECKALT(td, upath, pathp, i) \ + do { \ + int _error; \ + \ + _error = ibcs2_emul_find(td, upath, UIO_USERSPACE, pathp, i); \ + if (*(pathp) == NULL) \ + return (_error); \ + } while (0) -#define CHECKALTCREAT(p, sgp, path) \ - ibcs2_emul_find(td, sgp, ibcs2_emul_path, path, &(path), 1) +#define CHECKALTEXIST(td, upath, pathp) CHECKALT(td, upath, pathp, 0) +#define CHECKALTCREAT(td, upath, pathp) CHECKALT(td, upath, pathp, 1) #ifdef SPX_HACK -int spx_open(struct thread *td, void *uap); +int spx_open(struct thread *td); #endif #endif /* !_IBCS2_UTIL_H_ */ |