Module Name: src
Committed By: christos
Date: Thu Apr 14 00:59:06 UTC 2011
Modified Files:
src/sys/compat/linux/common: linux_file.c linux_pipe.c
Log Message:
move dup3 to a more appropriate place because pipe is "special". Gotta love
linux.
To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/compat/linux/common/linux_file.c
cvs rdiff -u -r1.64 -r1.65 src/sys/compat/linux/common/linux_pipe.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux/common/linux_file.c
diff -u src/sys/compat/linux/common/linux_file.c:1.102 src/sys/compat/linux/common/linux_file.c:1.103
--- src/sys/compat/linux/common/linux_file.c:1.102 Sun Apr 10 11:49:56 2011
+++ src/sys/compat/linux/common/linux_file.c Wed Apr 13 20:59:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_file.c,v 1.102 2011/04/10 15:49:56 christos Exp $ */
+/* $NetBSD: linux_file.c,v 1.103 2011/04/14 00:59:06 christos Exp $ */
/*-
* Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,13 +35,14 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.102 2011/04/10 15:49:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.103 2011/04/14 00:59:06 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/file.h>
+#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/filedesc.h>
#include <sys/ioctl.h>
@@ -621,6 +622,25 @@
return sys_pwrite(l, &pra, retval);
}
+int
+linux_sys_dup3(struct lwp *l, const struct linux_sys_dup3_args *uap,
+ register_t *retval)
+{
+ /* {
+ syscallarg(int) from;
+ syscallarg(int) to;
+ syscallarg(int) flags;
+ } */
+ int error;
+ if ((error = sys_dup2(l, (const struct sys_dup2_args *)uap, retval)))
+ return error;
+
+ if (SCARG(uap, flags) & LINUX_O_CLOEXEC)
+ fd_set_exclose(l, SCARG(uap, to), true);
+
+ return 0;
+}
+
#define LINUX_NOT_SUPPORTED(fun) \
int \
fun(struct lwp *l, const struct fun##_args *uap, register_t *retval) \
Index: src/sys/compat/linux/common/linux_pipe.c
diff -u src/sys/compat/linux/common/linux_pipe.c:1.64 src/sys/compat/linux/common/linux_pipe.c:1.65
--- src/sys/compat/linux/common/linux_pipe.c:1.64 Sun Apr 10 11:50:34 2011
+++ src/sys/compat/linux/common/linux_pipe.c Wed Apr 13 20:59:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_pipe.c,v 1.64 2011/04/10 15:50:34 christos Exp $ */
+/* $NetBSD: linux_pipe.c,v 1.65 2011/04/14 00:59:06 christos Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.64 2011/04/10 15:50:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.65 2011/04/14 00:59:06 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -130,22 +130,3 @@
return linux_pipe_return(l, SCARG(uap, pfds), retval,
SCARG(uap, flags));
}
-
-int
-linux_sys_dup3(struct lwp *l, const struct linux_sys_dup3_args *uap,
- register_t *retval)
-{
- /* {
- syscallarg(int) from;
- syscallarg(int) to;
- syscallarg(int) flags;
- } */
- int error;
- if ((error = sys_dup2(l, (const struct sys_dup2_args *)uap, retval)))
- return error;
-
- if (SCARG(uap, flags) & LINUX_O_CLOEXEC)
- fd_set_exclose(l, SCARG(uap, to), true);
-
- return 0;
-}