Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 2006 12:16:40 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 109788 for review
Message-ID:  <200611121216.kACCGeKt071938@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109788

Change 109788 by rdivacky@rdivacky_witten on 2006/11/12 12:16:38

	Implement linux_chroot as a wrapper to chroot. We need this to get
	errno translation. All syscalls that are directly mapped to FreeBSD
	syscalls suffer from this.
	
	Notice: this is untested (not even compilation) because -current
	is broken ATM :(

Affected files ...

.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#12 edit
.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#12 edit
.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#11 edit
.. //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#11 edit
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#32 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#12 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#11 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#11 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/syscalls.master#10 edit

Differences ...

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#12 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.26 2006/11/11 21:49:07 ru Exp $
- * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.23 2006/10/29 14:02:38 netchild Exp 
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.22 2006/10/28 10:59:59 netchild Exp 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -192,6 +192,9 @@
 struct linux_olduname_args {
 	register_t dummy;
 };
+struct linux_chroot_args {
+	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+};
 struct linux_ustat_args {
 	char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)];
 	char ubuf_l_[PADL_(struct l_ustat *)]; struct l_ustat * ubuf; char ubuf_r_[PADR_(struct l_ustat *)];
@@ -984,6 +987,7 @@
 int	linux_ioctl(struct thread *, struct linux_ioctl_args *);
 int	linux_fcntl(struct thread *, struct linux_fcntl_args *);
 int	linux_olduname(struct thread *, struct linux_olduname_args *);
+int	linux_chroot(struct thread *, struct linux_chroot_args *);
 int	linux_ustat(struct thread *, struct linux_ustat_args *);
 int	linux_getppid(struct thread *, struct linux_getppid_args *);
 int	linux_sigaction(struct thread *, struct linux_sigaction_args *);
@@ -1235,6 +1239,7 @@
 #define	LINUX_SYS_AUE_linux_ioctl	AUE_IOCTL
 #define	LINUX_SYS_AUE_linux_fcntl	AUE_FCNTL
 #define	LINUX_SYS_AUE_linux_olduname	AUE_NULL
+#define	LINUX_SYS_AUE_linux_chroot	AUE_CHROOT
 #define	LINUX_SYS_AUE_linux_ustat	AUE_NULL
 #define	LINUX_SYS_AUE_linux_getppid	AUE_GETPPID
 #define	LINUX_SYS_AUE_linux_sigaction	AUE_NULL

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#12 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.26 2006/11/11 21:49:07 ru Exp $
- * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.23 2006/10/29 14:02:38 netchild Exp 
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.22 2006/10/28 10:59:59 netchild Exp 
  */
 
 #define	LINUX_SYS_exit	1
@@ -57,7 +57,7 @@
 #define	LINUX_SYS_setpgid	57
 #define	LINUX_SYS_linux_olduname	59
 #define	LINUX_SYS_umask	60
-#define	LINUX_SYS_chroot	61
+#define	LINUX_SYS_linux_chroot	61
 #define	LINUX_SYS_linux_ustat	62
 #define	LINUX_SYS_dup2	63
 #define	LINUX_SYS_linux_getppid	64

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#11 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.26 2006/11/11 21:49:07 ru Exp $
- * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.23 2006/10/29 14:02:38 netchild Exp 
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.22 2006/10/28 10:59:59 netchild Exp 
  */
 
 #include <bsm/audit_kevents.h>
@@ -81,7 +81,7 @@
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 58 = ulimit */
 	{ 0, (sy_call_t *)linux_olduname, AUE_NULL, NULL, 0, 0 },	/* 59 = linux_olduname */
 	{ AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0 },	/* 60 = umask */
-	{ AS(chroot_args), (sy_call_t *)chroot, AUE_CHROOT, NULL, 0, 0 },	/* 61 = chroot */
+	{ AS(linux_chroot_args), (sy_call_t *)linux_chroot, AUE_CHROOT, NULL, 0, 0 },	/* 61 = linux_chroot */
 	{ AS(linux_ustat_args), (sy_call_t *)linux_ustat, AUE_NULL, NULL, 0, 0 },	/* 62 = linux_ustat */
 	{ AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0 },	/* 63 = dup2 */
 	{ 0, (sy_call_t *)linux_getppid, AUE_GETPPID, NULL, 0, 0 },	/* 64 = linux_getppid */

==== //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#11 (text+ko) ====

@@ -117,7 +117,7 @@
 58	AUE_NULL	UNIMPL	ulimit
 59	AUE_NULL	STD	{ int linux_olduname(void); }
 60	AUE_UMASK	NOPROTO	{ int umask(int newmask); }
-61	AUE_CHROOT	NOPROTO	{ int chroot(char *path); }
+61	AUE_CHROOT	STD	{ int linux_chroot(char *path); }
 62	AUE_NULL	STD	{ int linux_ustat(l_dev_t dev, \
 				    struct l_ustat *ubuf); }
 63	AUE_DUP2	NOPROTO	{ int dup2(u_int from, u_int to); }

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#32 (text+ko) ====

@@ -1672,3 +1672,9 @@
 
 	return (error);
 }
+
+int
+linux_chroot(struct thread *td, struct linux_chroot_args *args)
+{
+   	return (chroot(td, args));
+}

==== //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#12 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_proto.h,v 1.87 2006/11/11 16:26:56 trhodes Exp $
- * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.83 2006/10/29 14:02:39 netchild Exp 
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.82 2006/10/28 10:59:59 netchild Exp 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -196,6 +196,9 @@
 struct linux_olduname_args {
 	register_t dummy;
 };
+struct linux_chroot_args {
+	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+};
 struct linux_ustat_args {
 	char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)];
 	char ubuf_l_[PADL_(struct l_ustat *)]; struct l_ustat * ubuf; char ubuf_r_[PADR_(struct l_ustat *)];
@@ -1002,6 +1005,7 @@
 int	linux_ioctl(struct thread *, struct linux_ioctl_args *);
 int	linux_fcntl(struct thread *, struct linux_fcntl_args *);
 int	linux_olduname(struct thread *, struct linux_olduname_args *);
+int	linux_chroot(struct thread *, struct linux_chroot_args *);
 int	linux_ustat(struct thread *, struct linux_ustat_args *);
 int	linux_getppid(struct thread *, struct linux_getppid_args *);
 int	linux_sigaction(struct thread *, struct linux_sigaction_args *);
@@ -1254,6 +1258,7 @@
 #define	LINUX_SYS_AUE_linux_ioctl	AUE_IOCTL
 #define	LINUX_SYS_AUE_linux_fcntl	AUE_FCNTL
 #define	LINUX_SYS_AUE_linux_olduname	AUE_NULL
+#define	LINUX_SYS_AUE_linux_chroot	AUE_CHROOT
 #define	LINUX_SYS_AUE_linux_ustat	AUE_NULL
 #define	LINUX_SYS_AUE_linux_getppid	AUE_GETPPID
 #define	LINUX_SYS_AUE_linux_sigaction	AUE_NULL

==== //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#11 (text+ko) ====

@@ -58,7 +58,7 @@
 #define	LINUX_SYS_setpgid	57
 #define	LINUX_SYS_linux_olduname	59
 #define	LINUX_SYS_umask	60
-#define	LINUX_SYS_chroot	61
+#define	LINUX_SYS_linux_chroot	61
 #define	LINUX_SYS_linux_ustat	62
 #define	LINUX_SYS_dup2	63
 #define	LINUX_SYS_linux_getppid	64

==== //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#11 (text+ko) ====

@@ -80,7 +80,7 @@
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 58 = ulimit */
 	{ 0, (sy_call_t *)linux_olduname, AUE_NULL, NULL, 0, 0 },	/* 59 = linux_olduname */
 	{ AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0 },	/* 60 = umask */
-	{ AS(chroot_args), (sy_call_t *)chroot, AUE_CHROOT, NULL, 0, 0 },	/* 61 = chroot */
+	{ AS(linux_chroot_args), (sy_call_t *)linux_chroot, AUE_CHROOT, NULL, 0, 0 },	/* 61 = linux_chroot */
 	{ AS(linux_ustat_args), (sy_call_t *)linux_ustat, AUE_NULL, NULL, 0, 0 },	/* 62 = linux_ustat */
 	{ AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0 },	/* 63 = dup2 */
 	{ 0, (sy_call_t *)linux_getppid, AUE_GETPPID, NULL, 0, 0 },	/* 64 = linux_getppid */

==== //depot/projects/linuxolator/src/sys/i386/linux/syscalls.master#10 (text+ko) ====

@@ -117,7 +117,7 @@
 58	AUE_NULL	UNIMPL	ulimit
 59	AUE_NULL	STD	{ int linux_olduname(void); }
 60	AUE_UMASK	NOPROTO	{ int umask(int newmask); }
-61	AUE_CHROOT	NOPROTO	{ int chroot(char *path); }
+61	AUE_CHROOT	STD	{ int linux_chroot(char *path); }
 62	AUE_NULL	STD	{ int linux_ustat(l_dev_t dev, \
 				    struct l_ustat *ubuf); }
 63	AUE_DUP2	NOPROTO { int dup2(u_int from, u_int to); }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611121216.kACCGeKt071938>