diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2001-10-16 06:15:36 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2001-10-16 06:15:36 +0000 |
commit | 4c1e3817c469f491e007881e6345f8d0a3511fe3 (patch) | |
tree | e20b5146f823a6b6f76a9e8fd84352e5e8cde3bd /sys/compat | |
parent | 2bf1eed95b987c262df48519f3c204a5f6b719b8 (diff) | |
download | src-4c1e3817c469f491e007881e6345f8d0a3511fe3.tar.gz src-4c1e3817c469f491e007881e6345f8d0a3511fe3.zip |
Implement linux_chown and linux_lchown. The fchown syscall maps
directly to the native syscall, because no filename handling
needs to be done.
Tested by: Martin Blapp <mb@imp.ch>
Notes
Notes:
svn path=/head/; revision=85022
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_file.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index ed654ec011ed..4609a1b84b34 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1127,3 +1127,45 @@ linux_fcntl64(struct thread *td, struct linux_fcntl64_args *args) return (fcntl_common(td, args)); } #endif /* __i386__ */ + +int +linux_chown(struct thread *td, struct linux_chown_args *args) +{ + struct chown_args bsd; + caddr_t sg; + + sg = stackgap_init(); + CHECKALTEXIST(td, &sg, args->path); + +#ifdef DEBUG + if (ldebug(chown)) + printf(ARGS(chown, "%s, %d, %d"), args->path, args->uid, + args->gid); +#endif + + bsd.path = args->path; + bsd.uid = args->uid; + bsd.gid = args->gid; + return (chown(td, &bsd)); +} + +int +linux_lchown(struct thread *td, struct linux_lchown_args *args) +{ + struct lchown_args bsd; + caddr_t sg; + + sg = stackgap_init(); + CHECKALTEXIST(td, &sg, args->path); + +#ifdef DEBUG + if (ldebug(lchown)) + printf(ARGS(lchown, "%s, %d, %d"), args->path, args->uid, + args->gid); +#endif + + bsd.path = args->path; + bsd.uid = args->uid; + bsd.gid = args->gid; + return (lchown(td, &bsd)); +} |