Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/irix Added IRIX fcntl(F_GETBSDLK) and fcntl(F_GET...



details:   https://anonhg.NetBSD.org/src/rev/5801edca9cc8
branches:  trunk
changeset: 524941:5801edca9cc8
user:      manu <manu%NetBSD.org@localhost>
date:      Tue Apr 02 19:58:38 2002 +0000

description:
Added IRIX fcntl(F_GETBSDLK) and fcntl(F_GETBSDLKW)

diffstat:

 sys/compat/irix/irix_fcntl.c       |  73 ++++++++++++++++++++++++++++-
 sys/compat/irix/irix_fcntl.h       |  94 ++++++++++++++++++++++++++++++++++++++
 sys/compat/irix/irix_syscall.h     |   4 +-
 sys/compat/irix/irix_syscallargs.h |  12 +++-
 sys/compat/irix/irix_syscalls.c    |   6 +-
 sys/compat/irix/irix_sysent.c      |  10 ++--
 sys/compat/irix/syscalls.master    |   4 +-
 7 files changed, 186 insertions(+), 17 deletions(-)

diffs (truncated from 327 to 300 lines):

diff -r 4b8eead56b52 -r 5801edca9cc8 sys/compat/irix/irix_fcntl.c
--- a/sys/compat/irix/irix_fcntl.c      Tue Apr 02 19:16:59 2002 +0000
+++ b/sys/compat/irix/irix_fcntl.c      Tue Apr 02 19:58:38 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_fcntl.c,v 1.3 2002/02/23 22:43:56 manu Exp $ */
+/*     $NetBSD: irix_fcntl.c,v 1.4 2002/04/02 19:58:38 manu Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.3 2002/02/23 22:43:56 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.4 2002/04/02 19:58:38 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/signal.h>
@@ -45,12 +45,20 @@
 #include <sys/mount.h>
 #include <sys/proc.h>
 #include <sys/systm.h>
+#include <sys/fcntl.h>
 #include <sys/syscallargs.h>
 
 #include <compat/irix/irix_types.h>
 #include <compat/irix/irix_signal.h>
+#include <compat/irix/irix_fcntl.h>
 #include <compat/irix/irix_syscallargs.h>
 
+#include <compat/svr4/svr4_types.h>
+#include <compat/svr4/svr4_signal.h>
+#include <compat/svr4/svr4_ucontext.h>
+#include <compat/svr4/svr4_lwp.h>
+#include <compat/svr4/svr4_fcntl.h>
+#include <compat/svr4/svr4_syscallargs.h>
 
 int
 irix_sys_lseek64(p, v, retval)
@@ -87,3 +95,64 @@
 
        return sys_lseek(p, (void *)&cup, retval);
 }
+
+int
+irix_sys_fcntl(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       struct irix_sys_fcntl_args /* {
+               syscallarg(int) fd;
+               syscallarg(int) cmd;
+               syscallarg(char *)arg;
+       } */ *uap = v;
+       struct svr4_sys_fcntl_args cup;
+       int cmd;
+
+       cmd = SCARG(uap, cmd);
+       switch (cmd) {
+       case IRIX_F_CHKLK:
+       case IRIX_F_CHKLKW:
+       case IRIX_F_CLNLK:
+       case IRIX_F_DIOINFO:
+       case IRIX_F_FSGETXATTR:
+       case IRIX_F_FSSETXATTR:
+       case IRIX_F_GETBMAP:
+       case IRIX_F_FSSETDM:
+       case IRIX_F_RESVSP:
+       case IRIX_F_UNRESVSP:
+       case IRIX_F_RESVSP64:
+       case IRIX_F_UNRESVSP64:
+       case IRIX_F_GETBMAPA:
+       case IRIX_F_FSGETXATTRA:
+       case IRIX_F_SETBIOSIZE:
+       case IRIX_F_GETBIOSIZE:
+       case IRIX_F_GETOPS:
+       case IRIX_F_DMAPI:
+       case IRIX_F_FSYNC:
+       case IRIX_F_FSYNC64:
+       case IRIX_F_GETBDSATTR:
+       case IRIX_F_SETBDSATTR:
+       case IRIX_F_GETBMAPX:
+       case IRIX_F_SETPRIO:
+       case IRIX_F_GETPRIO:
+               printf("Warning: unimplemented IRIX fcntl() command %d\n", 
+                   cmd);
+               return EINVAL;
+               break;
+
+       case IRIX_F_SETBSDLKW:
+               cmd = SVR4_F_SETLKW;
+       case IRIX_F_SETBSDLK:
+               cmd = SVR4_F_SETLK;
+       default:
+               SCARG(&cup, fd) = SCARG(uap, fd);
+               SCARG(&cup, cmd) = cmd;
+               SCARG(&cup, arg) = SCARG(uap, arg);
+               return svr4_sys_fcntl(p, &cup, retval);
+               break;
+       }
+       /* NOTREACHED */
+}
+       
diff -r 4b8eead56b52 -r 5801edca9cc8 sys/compat/irix/irix_fcntl.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/irix/irix_fcntl.h      Tue Apr 02 19:58:38 2002 +0000
@@ -0,0 +1,94 @@
+/*     $NetBSD: irix_fcntl.h,v 1.1 2002/04/02 19:58:38 manu Exp $ */
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef        _IRIX_FCNTL_H_
+#define        _IRIX_FCNTL_H_
+
+#include <compat/svr4/svr4_fcntl.h>
+
+/* From IRIX's <sys/fcntl.h> */
+#define IRIX_F_DUPFD           SVR4_F_DUPFD
+#define IRIX_F_GETFD           SVR4_F_GETFD
+#define IRIX_F_SETFD           SVR4_F_SETFD
+#define IRIX_F_GETFL           SVR4_F_GETFL
+#define IRIX_F_SETFL           SVR4_F_SETFL
+#define IRIX_F_SETLK           SVR4_F_SETLK
+#define IRIX_F_SETLKW          SVR4_F_SETLKW
+#define IRIX_F_CHKFL           SVR4_F_CHKFL
+#define IRIX_F_ALLOCSP         SVR4_F_ALLOCSP
+#define IRIX_F_FREESP          SVR4_F_FREESP
+#define IRIX_F_SETBSDLK                12
+#define IRIX_F_SETBSDLKW       13
+#define IRIX_F_GETLK           SVR4_F_GETLK
+#define IRIX_F_CHKLK           15
+#define IRIX_F_CHKLKW          16
+#define IRIX_F_CLNLK           17
+#define IRIX_F_RSETLK          SVR4_F_RSETLK
+#define IRIX_F_RGETLK          SVR4_F_RGETLK
+#define IRIX_F_RSETLKW         SVR4_F_RSETLKW
+#define IRIX_F_GETOWN          SVR4_F_GETOWN
+#define IRIX_F_SETOWN          SVR4_F_SETOWN
+#define IRIX_F_DIOINFO         30
+#define IRIX_F_FSGETXATTR      31
+#define IRIX_F_FSSETXATTR      32
+#define IRIX_F_GETLK64         SVR4_F_GETLK64
+#define IRIX_F_SETLK64         SVR4_F_SETLK64
+#define IRIX_F_SETLKW64                SVR4_F_SETLKW64
+#define IRIX_F_ALLOCSP64       36
+#define IRIX_F_FREESP64                SVR4_F_FREESP64
+#define IRIX_F_GETBMAP         38
+#define IRIX_F_FSSETDM         39
+#define IRIX_F_RESVSP          40
+#define IRIX_F_UNRESVSP                41
+#define IRIX_F_RESVSP64                42
+#define IRIX_F_UNRESVSP64      43
+#define IRIX_F_GETBMAPA                44
+#define IRIX_F_FSGETXATTRA     45
+#define IRIX_F_SETBIOSIZE      46
+#define IRIX_F_GETBIOSIZE      47
+#define IRIX_F_GETOPS          50
+#define IRIX_F_DMAPI           51
+#define IRIX_F_FSYNC           52
+#define IRIX_F_FSYNC64         53
+#define IRIX_F_GETBDSATTR      54
+#define IRIX_F_SETBDSATTR      55
+#define IRIX_F_GETBMAPX                56
+#define IRIX_F_SETPRIO         57
+#define IRIX_F_GETPRIO         58
+
+#endif /* _IRIX_FCNTL_H_ */
diff -r 4b8eead56b52 -r 5801edca9cc8 sys/compat/irix/irix_syscall.h
--- a/sys/compat/irix/irix_syscall.h    Tue Apr 02 19:16:59 2002 +0000
+++ b/sys/compat/irix/irix_syscall.h    Tue Apr 02 19:58:38 2002 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: irix_syscall.h,v 1.31 2002/03/28 10:36:15 manu Exp $ */
+/* $NetBSD: irix_syscall.h,v 1.32 2002/04/02 19:58:38 manu Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.29 2002/03/26 10:52:52 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.30 2002/03/28 10:36:15 manu Exp 
  */
 
 /* syscall: "syscall" ret: "int" args: */
diff -r 4b8eead56b52 -r 5801edca9cc8 sys/compat/irix/irix_syscallargs.h
--- a/sys/compat/irix/irix_syscallargs.h        Tue Apr 02 19:16:59 2002 +0000
+++ b/sys/compat/irix/irix_syscallargs.h        Tue Apr 02 19:58:38 2002 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: irix_syscallargs.h,v 1.31 2002/03/28 10:36:14 manu Exp $ */
+/* $NetBSD: irix_syscallargs.h,v 1.32 2002/04/02 19:58:38 manu Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.29 2002/03/26 10:52:52 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.30 2002/03/28 10:36:15 manu Exp 
  */
 
 #ifndef _IRIX_SYS__SYSCALLARGS_H_
@@ -50,6 +50,12 @@
        syscallarg(void *) arg4;
 };
 
+struct irix_sys_fcntl_args {
+       syscallarg(int) fd;
+       syscallarg(int) cmd;
+       syscallarg(char *) arg;
+};
+
 struct irix_sys_lseek64_args {
        syscallarg(int) fd;
        syscallarg(int) pad1;
@@ -212,7 +218,7 @@
 int    svr4_sys_execve(struct proc *, void *, register_t *);
 int    sys_umask(struct proc *, void *, register_t *);
 int    sys_chroot(struct proc *, void *, register_t *);
-int    svr4_sys_fcntl(struct proc *, void *, register_t *);
+int    irix_sys_fcntl(struct proc *, void *, register_t *);
 int    svr4_sys_ulimit(struct proc *, void *, register_t *);
 int    irix_sys_lseek64(struct proc *, void *, register_t *);
 int    sys_rmdir(struct proc *, void *, register_t *);
diff -r 4b8eead56b52 -r 5801edca9cc8 sys/compat/irix/irix_syscalls.c
--- a/sys/compat/irix/irix_syscalls.c   Tue Apr 02 19:16:59 2002 +0000
+++ b/sys/compat/irix/irix_syscalls.c   Tue Apr 02 19:58:38 2002 +0000
@@ -1,14 +1,14 @@
-/* $NetBSD: irix_syscalls.c,v 1.31 2002/03/28 10:36:14 manu Exp $ */
+/* $NetBSD: irix_syscalls.c,v 1.32 2002/04/02 19:58:38 manu Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.29 2002/03/26 10:52:52 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.30 2002/03/28 10:36:15 manu Exp 
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_syscalls.c,v 1.31 2002/03/28 10:36:14 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_syscalls.c,v 1.32 2002/04/02 19:58:38 manu Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
diff -r 4b8eead56b52 -r 5801edca9cc8 sys/compat/irix/irix_sysent.c
--- a/sys/compat/irix/irix_sysent.c     Tue Apr 02 19:16:59 2002 +0000
+++ b/sys/compat/irix/irix_sysent.c     Tue Apr 02 19:58:38 2002 +0000
@@ -1,14 +1,14 @@
-/* $NetBSD: irix_sysent.c,v 1.31 2002/03/28 10:36:15 manu Exp $ */
+/* $NetBSD: irix_sysent.c,v 1.32 2002/04/02 19:58:39 manu Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.29 2002/03/26 10:52:52 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.30 2002/03/28 10:36:15 manu Exp 
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_sysent.c,v 1.31 2002/03/28 10:36:15 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_sysent.c,v 1.32 2002/04/02 19:58:39 manu Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -174,8 +174,8 @@
            sys_umask },                        /* 60 = umask */



Home | Main Index | Thread Index | Old Index