diff options
author | iedowse <iedowse@FreeBSD.org> | 2002-09-01 22:30:27 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2002-09-01 22:30:27 +0000 |
commit | 07f07ebc496d8282bdb12357703601f8cdead05f (patch) | |
tree | e78cb9954f69b7a52ffd80f19aed803a61801325 /sys/compat/linux/linux_uid16.c | |
parent | b1c6d21217f0b1736cdebae0cc283188d9ae4724 (diff) | |
download | FreeBSD-src-07f07ebc496d8282bdb12357703601f8cdead05f.zip FreeBSD-src-07f07ebc496d8282bdb12357703601f8cdead05f.tar.gz |
Use the new kern_* functions to avoid the need to store arguments
in the stack gap. This converts most VFS and signal related system
calls, as well as select().
Discussed on: -arch
Approved by: marcel
Diffstat (limited to 'sys/compat/linux/linux_uid16.c')
-rw-r--r-- | sys/compat/linux/linux_uid16.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c index ee39025..538c118 100644 --- a/sys/compat/linux/linux_uid16.c +++ b/sys/compat/linux/linux_uid16.c @@ -33,6 +33,7 @@ #include <sys/lock.h> #include <sys/mutex.h> #include <sys/proc.h> +#include <sys/syscallsubr.h> #include <sys/sysproto.h> #include <machine/../linux/linux.h> @@ -44,48 +45,43 @@ DUMMY(setfsgid16); DUMMY(getresuid16); DUMMY(getresgid16); -#define CAST_NOCHG(x) (x == 0xFFFF) ? -1 : x; +#define CAST_NOCHG(x) ((x == 0xFFFF) ? -1 : x) int linux_chown16(struct thread *td, struct linux_chown16_args *args) { - struct chown_args bsd; - caddr_t sg; + char *path; + int error; - sg = stackgap_init(); - CHECKALTEXIST(td, &sg, args->path); + LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(chown16)) - printf(ARGS(chown16, "%s, %d, %d"), args->path, args->uid, - args->gid); + printf(ARGS(chown16, "%s, %d, %d"), path, args->uid, args->gid); #endif - - bsd.path = args->path; - bsd.uid = CAST_NOCHG(args->uid); - bsd.gid = CAST_NOCHG(args->gid); - return (chown(td, &bsd)); + error = kern_chown(td, path, UIO_SYSSPACE, CAST_NOCHG(args->uid), + CAST_NOCHG(args->gid)); + LFREEPATH(path); + return (error); } int linux_lchown16(struct thread *td, struct linux_lchown16_args *args) { - struct lchown_args bsd; - caddr_t sg; + char *path; + int error; - sg = stackgap_init(); - CHECKALTEXIST(td, &sg, args->path); + LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(lchown16)) - printf(ARGS(lchown16, "%s, %d, %d"), args->path, args->uid, + printf(ARGS(lchown16, "%s, %d, %d"), path, args->uid, args->gid); #endif - - bsd.path = args->path; - bsd.uid = CAST_NOCHG(args->uid); - bsd.gid = CAST_NOCHG(args->gid); - return (lchown(td, &bsd)); + error = kern_lchown(td, path, UIO_SYSSPACE, CAST_NOCHG(args->uid), + CAST_NOCHG(args->gid)); + LFREEPATH(path); + return (error); } int |