Added IRIX fcntl(F_GETBSDLK) and fcntl(F_GETBSDLKW)
This commit is contained in:
parent
d3ffde02ce
commit
062e23b4e2
|
@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.3 2002/02/23 22:43:56 manu Exp $");
|
|||
#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 @@ 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 */
|
||||
}
|
||||
|
||||
|
|
|
@ -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_ */
|
|
@ -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: */
|
||||
|
|
|
@ -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 *);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 @@ 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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue