diff --git a/sys/compat/irix/irix_fcntl.c b/sys/compat/irix/irix_fcntl.c index 44d48eb24a1e..75c6f283d322 100644 --- a/sys/compat/irix/irix_fcntl.c +++ b/sys/compat/irix/irix_fcntl.c @@ -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 -__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 #include @@ -45,12 +45,20 @@ __KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.3 2002/02/23 22:43:56 manu Exp $"); #include #include #include +#include #include #include #include +#include #include +#include +#include +#include +#include +#include +#include int irix_sys_lseek64(p, v, retval) @@ -87,3 +95,64 @@ irix_sys_lseek64(p, v, retval) 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 --git a/sys/compat/irix/irix_fcntl.h b/sys/compat/irix/irix_fcntl.h new file mode 100644 index 000000000000..b65faf6c839d --- /dev/null +++ b/sys/compat/irix/irix_fcntl.h @@ -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 + +/* From IRIX's */ +#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 --git a/sys/compat/irix/irix_syscall.h b/sys/compat/irix/irix_syscall.h index ba80fee32c2e..8e0d7542e740 100644 --- a/sys/compat/irix/irix_syscall.h +++ b/sys/compat/irix/irix_syscall.h @@ -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 --git a/sys/compat/irix/irix_syscallargs.h b/sys/compat/irix/irix_syscallargs.h index a07bbd102e8e..2b9d5527b24f 100644 --- a/sys/compat/irix/irix_syscallargs.h +++ b/sys/compat/irix/irix_syscallargs.h @@ -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 @@ struct irix_sys_sysmp_args { 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_utssys(struct proc *, void *, register_t *); 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 --git a/sys/compat/irix/irix_syscalls.c b/sys/compat/irix/irix_syscalls.c index 9da073750556..209e59c0fe48 100644 --- a/sys/compat/irix/irix_syscalls.c +++ b/sys/compat/irix/irix_syscalls.c @@ -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 -__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 --git a/sys/compat/irix/irix_sysent.c b/sys/compat/irix/irix_sysent.c index ccbfe8a380fd..c735109b47b7 100644 --- a/sys/compat/irix/irix_sysent.c +++ b/sys/compat/irix/irix_sysent.c @@ -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 -__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 @@ struct sysent irix_sysent[] = { sys_umask }, /* 60 = umask */ { 1, s(struct sys_chroot_args), 0, sys_chroot }, /* 61 = chroot */ - { 3, s(struct svr4_sys_fcntl_args), 0, - svr4_sys_fcntl }, /* 62 = fcntl */ + { 3, s(struct irix_sys_fcntl_args), 0, + irix_sys_fcntl }, /* 62 = fcntl */ { 2, s(struct svr4_sys_ulimit_args), 0, svr4_sys_ulimit }, /* 63 = ulimit */ { 0, 0, 0, diff --git a/sys/compat/irix/syscalls.master b/sys/compat/irix/syscalls.master index 73a0aa55925e..9d34ed1a9ec4 100644 --- a/sys/compat/irix/syscalls.master +++ b/sys/compat/irix/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.30 2002/03/28 10:36:15 manu Exp $ + $NetBSD: syscalls.master,v 1.31 2002/04/02 19:58:39 manu Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -144,7 +144,7 @@ char **envp); } 60 NOARGS { int sys_umask(int newmask); } 61 NOARGS { int sys_chroot(char *path); } -62 NOARGS { int svr4_sys_fcntl(int fd, int cmd, char *arg); } +62 STD { int irix_sys_fcntl(int fd, int cmd, char *arg); } 63 NOARGS { long svr4_sys_ulimit(int cmd, long newlimit); } 64 UNIMPL reserved for unix/pc 65 UNIMPL reserved for unix/pc