summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2001-10-16 06:15:36 +0000
committermarcel <marcel@FreeBSD.org>2001-10-16 06:15:36 +0000
commitff7999f46e97905d95790b69eab2a0e64dafe817 (patch)
treee20b5146f823a6b6f76a9e8fd84352e5e8cde3bd /sys/compat
parent70723ad045046977eb6313ddd377426820960276 (diff)
downloadFreeBSD-src-ff7999f46e97905d95790b69eab2a0e64dafe817.zip
FreeBSD-src-ff7999f46e97905d95790b69eab2a0e64dafe817.tar.gz
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>
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_file.c42
1 files changed, 42 insertions, 0 deletions
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));
+}
OpenPOWER on IntegriCloud