Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/linux Added initial support for fcntl64 system ca...
details: https://anonhg.NetBSD.org/src/rev/3898a725b845
branches: trunk
changeset: 515640:3898a725b845
user: manu <manu%NetBSD.org@localhost>
date: Sun Sep 30 16:04:03 2001 +0000
description:
Added initial support for fcntl64 system call (file locking is not
implemented)
diffstat:
sys/compat/linux/arch/i386/linux_fcntl.h | 5 ++-
sys/compat/linux/arch/m68k/linux_fcntl.h | 5 ++-
sys/compat/linux/arch/mips/linux_fcntl.h | 9 +++++-
sys/compat/linux/arch/powerpc/linux_fcntl.h | 6 +++-
sys/compat/linux/common/linux_file64.c | 42 ++++++++++++++++++++++++++++-
5 files changed, 62 insertions(+), 5 deletions(-)
diffs (126 lines):
diff -r 0e319fd353ed -r 3898a725b845 sys/compat/linux/arch/i386/linux_fcntl.h
--- a/sys/compat/linux/arch/i386/linux_fcntl.h Sun Sep 30 15:54:38 2001 +0000
+++ b/sys/compat/linux/arch/i386/linux_fcntl.h Sun Sep 30 16:04:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fcntl.h,v 1.3 1998/10/04 00:02:25 fvdl Exp $ */
+/* $NetBSD: linux_fcntl.h,v 1.4 2001/09/30 16:04:03 manu Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -75,4 +75,7 @@
#define LINUX_LOCK_EX 4
#define LINUX_LOCK_SH 8
+#define LINUX_F_GETLK64 12
+#define LINUX_F_SETLK64 13
+#define LINUX_F_SETLKW64 14
#endif /* !_I386_LINUX_FCNTL_H */
diff -r 0e319fd353ed -r 3898a725b845 sys/compat/linux/arch/m68k/linux_fcntl.h
--- a/sys/compat/linux/arch/m68k/linux_fcntl.h Sun Sep 30 15:54:38 2001 +0000
+++ b/sys/compat/linux/arch/m68k/linux_fcntl.h Sun Sep 30 16:04:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fcntl.h,v 1.1 1998/12/15 19:25:40 itohy Exp $ */
+/* $NetBSD: linux_fcntl.h,v 1.2 2001/09/30 16:04:03 manu Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -83,4 +83,7 @@
#define LINUX_LOCK_NB 4
#define LINUX_LOCK_UN 8
+#define LINUX_F_GETLK64 12
+#define LINUX_F_SETLK64 13
+#define LINUX_F_SETLKW64 14
#endif /* !_M68K_LINUX_FCNTL_H */
diff -r 0e319fd353ed -r 3898a725b845 sys/compat/linux/arch/mips/linux_fcntl.h
--- a/sys/compat/linux/arch/mips/linux_fcntl.h Sun Sep 30 15:54:38 2001 +0000
+++ b/sys/compat/linux/arch/mips/linux_fcntl.h Sun Sep 30 16:04:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fcntl.h,v 1.1 2001/08/26 15:38:44 manu Exp $ */
+/* $NetBSD: linux_fcntl.h,v 1.2 2001/09/30 16:04:04 manu Exp $ */
/*-
* Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc.
@@ -84,4 +84,11 @@
#define LINUX_LOCK_EX 4 /* F_EXLCK in Linux, and comment "or 3 " */
#define LINUX_LOCK_SH 8 /* F_SHLCK in Linux, and comment "or 4' */
+/*
+ * From Linux's include/asm-mips64/fcntl.h
+ */
+#define LINUX_F_GETLK64 33
+#define LINUX_F_SETLK64 34
+#define LINUX_F_SETLKW64 35
+
#endif /* !_MIPS_LINUX_FCNTL_H */
diff -r 0e319fd353ed -r 3898a725b845 sys/compat/linux/arch/powerpc/linux_fcntl.h
--- a/sys/compat/linux/arch/powerpc/linux_fcntl.h Sun Sep 30 15:54:38 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_fcntl.h Sun Sep 30 16:04:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fcntl.h,v 1.3 2001/02/04 22:59:26 christos Exp $ */
+/* $NetBSD: linux_fcntl.h,v 1.4 2001/09/30 16:04:04 manu Exp $ */
/*-
* Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc.
@@ -85,4 +85,8 @@
#define LINUX_LOCK_EX 4 /* F_EXLCK in Linux, and comment "or 3 " */
#define LINUX_LOCK_SH 8 /* F_SHLCK in Linux, and comment "or 4' */
+#define LINUX_F_GETLK64 12
+#define LINUX_F_SETLK64 13
+#define LINUX_F_SETLKW64 14
+
#endif /* !_POWERPC_LINUX_FCNTL_H */
diff -r 0e319fd353ed -r 3898a725b845 sys/compat/linux/common/linux_file64.c
--- a/sys/compat/linux/common/linux_file64.c Sun Sep 30 15:54:38 2001 +0000
+++ b/sys/compat/linux/common/linux_file64.c Sun Sep 30 16:04:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_file64.c,v 1.2 2000/12/12 22:24:56 jdolecek Exp $ */
+/* $NetBSD: linux_file64.c,v 1.3 2001/09/30 16:04:04 manu Exp $ */
/*-
* Copyright (c) 1995, 1998, 2000 The NetBSD Foundation, Inc.
@@ -220,3 +220,43 @@
return sys_truncate(p, uap, retval);
}
+
+#ifndef __alpha__
+int
+linux_sys_fcntl64(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct linux_sys_fcntl64_args /* {
+ syscallarg(unsigned int) fd;
+ syscallarg(unsigned int) cmd;
+ syscallarg(unsigned long) arg;
+ } */ *uap = v;
+ unsigned int fd, cmd;
+ unsigned long arg;
+ int error;
+
+ fd = SCARG(uap, fd);
+ cmd = SCARG(uap, cmd);
+ arg = SCARG(uap, arg);
+
+ switch (cmd) {
+ /* XXX implement this later */
+ case LINUX_F_GETLK64:
+ error = 0;
+ break;
+ case LINUX_F_SETLK64:
+ error = 0;
+ break;
+ case LINUX_F_SETLKW64:
+ error = 0;
+ break;
+ default:
+ error = linux_sys_fcntl(p, v, retval);
+ break;
+ }
+
+ return error;
+}
+#endif /* __alpha__ */
Home |
Main Index |
Thread Index |
Old Index