From ff7999f46e97905d95790b69eab2a0e64dafe817 Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 16 Oct 2001 06:15:36 +0000 Subject: 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 --- sys/compat/linux/linux_file.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'sys/compat/linux/linux_file.c') diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index ed654ec..4609a1b 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)); +} -- cgit v1.1