Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/linux/common Add Linux specific fcntl(2) commands...
details: https://anonhg.NetBSD.org/src/rev/e8ddc420279e
branches: trunk
changeset: 336438:e8ddc420279e
user: njoly <njoly%NetBSD.org@localhost>
date: Sun Mar 01 13:19:39 2015 +0000
description:
Add Linux specific fcntl(2) commands. Support F_DUPFD_CLOEXEC.
diffstat:
sys/compat/linux/common/linux_fcntl.h | 12 +++++++++++-
sys/compat/linux/common/linux_file.c | 8 ++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
diffs (55 lines):
diff -r ec12cfbe7071 -r e8ddc420279e sys/compat/linux/common/linux_fcntl.h
--- a/sys/compat/linux/common/linux_fcntl.h Sun Mar 01 11:19:08 2015 +0000
+++ b/sys/compat/linux/common/linux_fcntl.h Sun Mar 01 13:19:39 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fcntl.h,v 1.16 2014/06/01 13:42:12 njoly Exp $ */
+/* $NetBSD: linux_fcntl.h,v 1.17 2015/03/01 13:19:39 njoly Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -87,6 +87,16 @@
#error Undefined linux_fcntl.h machine type.
#endif
+/* Linux specific fcntl(2) commands */
+#define LINUX_F_SPECIFIC_BASE 1024
+#define LINUX_F_SETLEASE (LINUX_F_SPECIFIC_BASE + 0)
+#define LINUX_F_GETLEASE (LINUX_F_SPECIFIC_BASE + 1)
+#define LINUX_F_NOTIFY (LINUX_F_SPECIFIC_BASE + 2)
+#define LINUX_F_CANCELLK (LINUX_F_SPECIFIC_BASE + 5)
+#define LINUX_F_DUPFD_CLOEXEC (LINUX_F_SPECIFIC_BASE + 6)
+#define LINUX_F_SETPIPE_SZ (LINUX_F_SPECIFIC_BASE + 7)
+#define LINUX_F_GETPIPE_SZ (LINUX_F_SPECIFIC_BASE + 8)
+
/*
* We have to have 4 copies of the code that converts linux fcntl() file
* locking to native form because there are 4 layouts for the structures.
diff -r ec12cfbe7071 -r e8ddc420279e sys/compat/linux/common/linux_file.c
--- a/sys/compat/linux/common/linux_file.c Sun Mar 01 11:19:08 2015 +0000
+++ b/sys/compat/linux/common/linux_file.c Sun Mar 01 13:19:39 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_file.c,v 1.114 2014/11/09 17:48:08 maxv Exp $ */
+/* $NetBSD: linux_file.c,v 1.115 2015/03/01 13:19:39 njoly Exp $ */
/*-
* Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.114 2014/11/09 17:48:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.115 2015/03/01 13:19:39 njoly Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -417,6 +417,10 @@
mutex_exit(proc_lock);
return 0;
+ case LINUX_F_DUPFD_CLOEXEC:
+ cmd = F_DUPFD_CLOEXEC;
+ break;
+
default:
return EOPNOTSUPP;
}
Home |
Main Index |
Thread Index |
Old Index