- Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.
- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports
- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));
- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
2002-09-22 01:14:54 +04:00
|
|
|
/* $NetBSD: netbsd32_netbsd.c,v 1.65 2002/09/21 21:14:58 manu Exp $ */
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/*
|
2001-02-08 16:19:33 +03:00
|
|
|
* Copyright (c) 1998, 2001 Matthew R. Green
|
1998-08-26 14:20:33 +04:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* 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. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
|
|
|
*/
|
|
|
|
|
2001-11-13 05:07:52 +03:00
|
|
|
#include <sys/cdefs.h>
|
- Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.
- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports
- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));
- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
2002-09-22 01:14:54 +04:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.65 2002/09/21 21:14:58 manu Exp $");
|
2001-11-13 05:07:52 +03:00
|
|
|
|
2001-05-30 15:37:21 +04:00
|
|
|
#if defined(_KERNEL_OPT)
|
2000-05-31 00:54:26 +04:00
|
|
|
#include "opt_ddb.h"
|
1998-08-30 19:32:16 +04:00
|
|
|
#include "opt_ktrace.h"
|
1998-10-01 18:27:56 +04:00
|
|
|
#include "opt_ntp.h"
|
1999-12-30 18:40:45 +03:00
|
|
|
#include "opt_compat_netbsd.h"
|
1998-12-18 16:18:42 +03:00
|
|
|
#include "opt_compat_43.h"
|
1999-12-30 18:40:45 +03:00
|
|
|
#include "opt_sysv.h"
|
1998-12-18 16:18:42 +03:00
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
#include "fs_lfs.h"
|
|
|
|
#include "fs_nfs.h"
|
2000-12-02 00:48:24 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux,
|
|
|
|
* HP-UX, FreeBSD, Ultrix, OSF1, we define it unconditionally so that
|
|
|
|
* this would be LKM-safe.
|
|
|
|
*/
|
|
|
|
#define COMPAT_OLDSOCK /* used by <sys/socket.h> */
|
1998-08-30 19:32:16 +04:00
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
1998-10-01 18:27:56 +04:00
|
|
|
#include <sys/kernel.h>
|
2001-02-08 16:19:33 +03:00
|
|
|
//#define msg __msg /* Don't ask me! */
|
1998-08-26 14:20:33 +04:00
|
|
|
#include <sys/malloc.h>
|
|
|
|
#include <sys/mount.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/sockio.h>
|
1998-10-01 18:27:56 +04:00
|
|
|
#include <sys/socketvar.h>
|
|
|
|
#include <sys/mbuf.h>
|
1998-08-26 14:20:33 +04:00
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/time.h>
|
1998-08-30 19:32:16 +04:00
|
|
|
#include <sys/signalvar.h>
|
1998-10-01 18:27:56 +04:00
|
|
|
#include <sys/ptrace.h>
|
|
|
|
#include <sys/ktrace.h>
|
|
|
|
#include <sys/trace.h>
|
|
|
|
#include <sys/resourcevar.h>
|
|
|
|
#include <sys/pool.h>
|
|
|
|
#include <sys/vnode.h>
|
|
|
|
#include <sys/file.h>
|
|
|
|
#include <sys/filedesc.h>
|
|
|
|
#include <sys/namei.h>
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2000-06-26 18:20:25 +04:00
|
|
|
#include <uvm/uvm_extern.h>
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
#include <sys/syscallargs.h>
|
1998-10-01 18:27:56 +04:00
|
|
|
#include <sys/proc.h>
|
1999-12-30 18:40:45 +03:00
|
|
|
#include <sys/acct.h>
|
|
|
|
#include <sys/exec.h>
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
#include <net/if.h>
|
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
#include <compat/netbsd32/netbsd32.h>
|
2000-12-02 00:48:24 +03:00
|
|
|
#include <compat/netbsd32/netbsd32_syscall.h>
|
1999-03-25 19:22:49 +03:00
|
|
|
#include <compat/netbsd32/netbsd32_syscallargs.h>
|
2001-02-07 18:22:39 +03:00
|
|
|
#include <compat/netbsd32/netbsd32_conv.h>
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1998-08-30 19:32:16 +04:00
|
|
|
#include <machine/frame.h>
|
|
|
|
|
2000-05-31 00:54:26 +04:00
|
|
|
#if defined(DDB)
|
|
|
|
#include <ddb/ddbvar.h>
|
|
|
|
#endif
|
|
|
|
|
2000-12-02 00:48:24 +03:00
|
|
|
extern char netbsd32_sigcode[], netbsd32_esigcode[];
|
|
|
|
extern struct sysent netbsd32_sysent[];
|
|
|
|
#ifdef SYSCALL_DEBUG
|
|
|
|
extern const char * const netbsd32_syscallnames[];
|
|
|
|
#endif
|
2000-12-12 11:00:26 +03:00
|
|
|
#ifdef __HAVE_SYSCALL_INTERN
|
2001-06-19 04:36:21 +04:00
|
|
|
void netbsd32_syscall_intern __P((struct proc *));
|
2000-12-12 11:00:26 +03:00
|
|
|
#else
|
2000-12-09 15:38:23 +03:00
|
|
|
void syscall __P((void));
|
2000-12-12 11:00:26 +03:00
|
|
|
#endif
|
2000-12-02 00:48:24 +03:00
|
|
|
|
|
|
|
const struct emul emul_netbsd32 = {
|
|
|
|
"netbsd32",
|
|
|
|
"/emul/netbsd32",
|
2000-12-12 11:00:26 +03:00
|
|
|
#ifndef __HAVE_MINIMAL_EMUL
|
|
|
|
0,
|
2000-12-02 00:48:24 +03:00
|
|
|
NULL,
|
|
|
|
netbsd32_SYS_syscall,
|
|
|
|
netbsd32_SYS_MAXSYSCALL,
|
2000-12-12 11:00:26 +03:00
|
|
|
#endif
|
2000-12-02 00:48:24 +03:00
|
|
|
netbsd32_sysent,
|
|
|
|
#ifdef SYSCALL_DEBUG
|
|
|
|
netbsd32_syscallnames,
|
|
|
|
#else
|
|
|
|
NULL,
|
|
|
|
#endif
|
2000-12-12 11:00:26 +03:00
|
|
|
netbsd32_sendsig,
|
2001-06-18 06:00:48 +04:00
|
|
|
trapsignal,
|
2000-12-02 00:48:24 +03:00
|
|
|
netbsd32_sigcode,
|
|
|
|
netbsd32_esigcode,
|
2001-09-18 23:36:32 +04:00
|
|
|
netbsd32_setregs,
|
2000-12-09 15:38:23 +03:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2000-12-12 11:00:26 +03:00
|
|
|
#ifdef __HAVE_SYSCALL_INTERN
|
2001-06-19 04:36:21 +04:00
|
|
|
netbsd32_syscall_intern,
|
2000-12-12 11:00:26 +03:00
|
|
|
#else
|
|
|
|
syscall,
|
|
|
|
#endif
|
- Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.
- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports
- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));
- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
2002-09-22 01:14:54 +04:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2000-12-02 00:48:24 +03:00
|
|
|
};
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
/*
|
|
|
|
* below are all the standard NetBSD system calls, in the 32bit
|
2000-07-09 17:39:31 +04:00
|
|
|
* environment, with the necessary conversions to 64bit before
|
2001-02-08 16:19:33 +03:00
|
|
|
* calling the real syscall. anything that needs special
|
|
|
|
* attention is handled elsewhere.
|
1998-08-26 14:20:33 +04:00
|
|
|
*/
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_exit(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_exit_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) rval;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_exit_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(rval);
|
2000-12-02 00:48:24 +03:00
|
|
|
return sys_exit(p, &ua, retval);
|
1998-10-01 18:27:56 +04:00
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_read(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_read_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) buf;
|
|
|
|
syscallarg(netbsd32_size_t) nbyte;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_read_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TOP_UAP(buf, void *);
|
|
|
|
NETBSD32TOX_UAP(nbyte, size_t);
|
1998-10-01 18:27:56 +04:00
|
|
|
return sys_read(p, &ua, retval);
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_write(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_write_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_voidp) buf;
|
|
|
|
syscallarg(netbsd32_size_t) nbyte;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_write_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TOP_UAP(buf, void *);
|
|
|
|
NETBSD32TOX_UAP(nbyte, size_t);
|
1998-10-01 18:27:56 +04:00
|
|
|
return sys_write(p, &ua, retval);
|
|
|
|
}
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_close(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_close_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_close_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
2000-01-01 01:26:21 +03:00
|
|
|
return sys_close(p, &ua, retval);
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_open(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_open_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) flags;
|
|
|
|
syscallarg(mode_t) mode;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_open_args ua;
|
|
|
|
caddr_t sg;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
|
|
|
NETBSD32TO64_UAP(mode);
|
2002-03-16 23:43:48 +03:00
|
|
|
sg = stackgap_init(p, 0);
|
2000-12-01 15:28:30 +03:00
|
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_open(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_link(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_link_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
|
|
|
syscallarg(const netbsd32_charp) link;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_link_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TOP_UAP(link, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_link(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_unlink(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_unlink_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_unlink_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_unlink(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_chdir(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_chdir_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_chdir_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_chdir(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_fchdir(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_fchdir_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fchdir_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
1998-10-01 18:27:56 +04:00
|
|
|
|
|
|
|
return (sys_fchdir(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_mknod(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_mknod_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(mode_t) mode;
|
|
|
|
syscallarg(dev_t) dev;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_mknod_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(dev);
|
|
|
|
NETBSD32TO64_UAP(mode);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_mknod(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_chmod(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_chmod_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(mode_t) mode;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_chmod_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(mode);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_chmod(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_chown(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_chown_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(uid_t) uid;
|
|
|
|
syscallarg(gid_t) gid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_chown_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(uid);
|
|
|
|
NETBSD32TO64_UAP(gid);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_chown(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_break(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_break_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_charp) nsize;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_obreak_args ua;
|
|
|
|
|
|
|
|
SCARG(&ua, nsize) = (char *)(u_long)SCARG(uap, nsize);
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(nsize, char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_obreak(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_mount(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_mount_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) type;
|
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) flags;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) data;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_mount_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(type, const char);
|
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
|
|
|
NETBSD32TOP_UAP(data, void);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_mount(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_unmount(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_unmount_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) flags;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_unmount_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_unmount(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setuid(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setuid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(uid_t) uid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setuid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(uid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_setuid(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_ptrace(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_ptrace_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) req;
|
|
|
|
syscallarg(pid_t) pid;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) addr;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) data;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_ptrace_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(req);
|
|
|
|
NETBSD32TO64_UAP(pid);
|
|
|
|
NETBSD32TOX64_UAP(addr, caddr_t);
|
|
|
|
NETBSD32TO64_UAP(data);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_ptrace(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_accept(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_accept_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_sockaddrp_t) name;
|
|
|
|
syscallarg(netbsd32_intp) anamelen;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_accept_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TOP_UAP(name, struct sockaddr);
|
|
|
|
NETBSD32TOP_UAP(anamelen, int);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_accept(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_getpeername(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_getpeername_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fdes;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_sockaddrp_t) asa;
|
|
|
|
syscallarg(netbsd32_intp) alen;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_getpeername_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fdes);
|
|
|
|
NETBSD32TOP_UAP(asa, struct sockaddr);
|
|
|
|
NETBSD32TOP_UAP(alen, int);
|
1998-10-01 18:27:56 +04:00
|
|
|
/* NB: do the protocol specific sockaddrs need to be converted? */
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_getpeername(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_getsockname(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_getsockname_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fdes;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_sockaddrp_t) asa;
|
|
|
|
syscallarg(netbsd32_intp) alen;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_getsockname_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fdes);
|
|
|
|
NETBSD32TOP_UAP(asa, struct sockaddr);
|
|
|
|
NETBSD32TOP_UAP(alen, int);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_getsockname(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_access(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_access_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) flags;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_access_args ua;
|
|
|
|
caddr_t sg;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
2002-03-16 23:43:48 +03:00
|
|
|
sg = stackgap_init(p, 0);
|
2000-12-01 15:28:30 +03:00
|
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_access(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_chflags(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_chflags_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
|
|
|
syscallarg(netbsd32_u_long) flags;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_chflags_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_chflags(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_fchflags(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_fchflags_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_u_long) flags;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fchflags_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_fchflags(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
2001-02-02 16:05:18 +03:00
|
|
|
int
|
|
|
|
netbsd32_lchflags(p, v, retval)
|
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
|
|
|
struct netbsd32_lchflags_args /* {
|
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(netbsd32_u_long) flags;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_lchflags_args ua;
|
|
|
|
|
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
|
|
|
|
|
|
|
return (sys_lchflags(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_kill(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_kill_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) pid;
|
|
|
|
syscallarg(int) signum;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_kill_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(pid);
|
|
|
|
NETBSD32TO64_UAP(signum);
|
1998-10-01 18:27:56 +04:00
|
|
|
|
|
|
|
return (sys_kill(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_dup(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_dup_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_dup_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
1998-10-01 18:27:56 +04:00
|
|
|
|
|
|
|
return (sys_dup(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_profil(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_profil_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) samples;
|
|
|
|
syscallarg(netbsd32_size_t) size;
|
|
|
|
syscallarg(netbsd32_u_long) offset;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(u_int) scale;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_profil_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOX64_UAP(samples, caddr_t);
|
|
|
|
NETBSD32TOX_UAP(size, size_t);
|
|
|
|
NETBSD32TOX_UAP(offset, u_long);
|
|
|
|
NETBSD32TO64_UAP(scale);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_profil(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
2000-12-02 00:48:24 +03:00
|
|
|
#ifdef KTRACE
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_ktrace(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_ktrace_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) fname;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) ops;
|
|
|
|
syscallarg(int) facs;
|
|
|
|
syscallarg(int) pid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_ktrace_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(fname, const char);
|
|
|
|
NETBSD32TO64_UAP(ops);
|
|
|
|
NETBSD32TO64_UAP(facs);
|
|
|
|
NETBSD32TO64_UAP(pid);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_ktrace(p, &ua, retval));
|
|
|
|
}
|
2000-12-02 00:48:24 +03:00
|
|
|
#endif /* KTRACE */
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2001-02-02 16:05:18 +03:00
|
|
|
int
|
|
|
|
netbsd32_utrace(p, v, retval)
|
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
|
|
|
struct netbsd32_utrace_args /* {
|
|
|
|
syscallarg(const netbsd32_charp) label;
|
|
|
|
syscallarg(netbsd32_voidp) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_utrace_args ua;
|
|
|
|
|
|
|
|
NETBSD32TOP_UAP(label, const char);
|
|
|
|
NETBSD32TOP_UAP(addr, void);
|
|
|
|
NETBSD32TO64_UAP(len);
|
|
|
|
return (sys_utrace(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32___getlogin(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32___getlogin_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_charp) namebuf;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(u_int) namelen;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys___getlogin_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(namebuf, char);
|
|
|
|
NETBSD32TO64_UAP(namelen);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys___getlogin(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setlogin(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setlogin_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) namebuf;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setlogin_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(namebuf, char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_setlogin(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_acct(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_acct_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_acct_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_acct(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_revoke(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_revoke_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_revoke_args ua;
|
|
|
|
caddr_t sg;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
2002-03-16 23:43:48 +03:00
|
|
|
sg = stackgap_init(p, 0);
|
2000-12-01 15:28:30 +03:00
|
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_revoke(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_symlink(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_symlink_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
|
|
|
syscallarg(const netbsd32_charp) link;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_symlink_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TOP_UAP(link, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_symlink(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_readlink(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_readlink_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
|
|
|
syscallarg(netbsd32_charp) buf;
|
|
|
|
syscallarg(netbsd32_size_t) count;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_readlink_args ua;
|
|
|
|
caddr_t sg;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TOP_UAP(buf, char);
|
|
|
|
NETBSD32TOX_UAP(count, size_t);
|
2002-03-16 23:43:48 +03:00
|
|
|
sg = stackgap_init(p, 0);
|
2001-01-22 23:08:03 +03:00
|
|
|
CHECK_ALT_SYMLINK(p, &sg, SCARG(&ua, path));
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (sys_readlink(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_umask(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_umask_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(mode_t) newmask;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_umask_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(newmask);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_umask(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_chroot(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_chroot_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_chroot_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_chroot(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_sbrk(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_sbrk_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) incr;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_sbrk_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(incr);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_sbrk(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_sstk(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_sstk_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) incr;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_sstk_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(incr);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_sstk(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_munmap(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_munmap_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_munmap_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(addr, void);
|
|
|
|
NETBSD32TOX_UAP(len, size_t);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_munmap(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_mprotect(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_mprotect_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) prot;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_mprotect_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(addr, void);
|
|
|
|
NETBSD32TOX_UAP(len, size_t);
|
|
|
|
NETBSD32TO64_UAP(prot);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_mprotect(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_madvise(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_madvise_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) behav;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_madvise_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(addr, void);
|
|
|
|
NETBSD32TOX_UAP(len, size_t);
|
|
|
|
NETBSD32TO64_UAP(behav);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_madvise(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_mincore(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_mincore_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
|
|
|
syscallarg(netbsd32_charp) vec;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_mincore_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOX64_UAP(addr, caddr_t);
|
|
|
|
NETBSD32TOX_UAP(len, size_t);
|
|
|
|
NETBSD32TOP_UAP(vec, char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_mincore(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
2001-02-08 16:19:33 +03:00
|
|
|
/* XXX MOVE ME XXX ? */
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_getgroups(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_getgroups_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) gidsetsize;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_gid_tp) gidset;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
2000-03-30 15:24:16 +04:00
|
|
|
struct pcred *pc = p->p_cred;
|
|
|
|
int ngrp;
|
1998-10-01 18:27:56 +04:00
|
|
|
int error;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
ngrp = SCARG(uap, gidsetsize);
|
|
|
|
if (ngrp == 0) {
|
|
|
|
*retval = pc->pc_ucred->cr_ngroups;
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
if (ngrp < pc->pc_ucred->cr_ngroups)
|
|
|
|
return (EINVAL);
|
|
|
|
ngrp = pc->pc_ucred->cr_ngroups;
|
1999-03-25 19:22:49 +03:00
|
|
|
/* Should convert gid_t to netbsd32_gid_t, but they're the same */
|
1998-10-01 18:27:56 +04:00
|
|
|
error = copyout((caddr_t)pc->pc_ucred->cr_groups,
|
|
|
|
(caddr_t)(u_long)SCARG(uap, gidset),
|
|
|
|
ngrp * sizeof(gid_t));
|
|
|
|
if (error)
|
|
|
|
return (error);
|
|
|
|
*retval = ngrp;
|
|
|
|
return (0);
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setgroups(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setgroups_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) gidsetsize;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_gid_tp) gidset;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setgroups_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(gidsetsize);
|
|
|
|
NETBSD32TOP_UAP(gidset, gid_t);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_setgroups(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setpgid(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setpgid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) pid;
|
|
|
|
syscallarg(int) pgid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setpgid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(pid);
|
|
|
|
NETBSD32TO64_UAP(pgid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_setpgid(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_fcntl(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_fcntl_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(int) cmd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) arg;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fcntl_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(cmd);
|
|
|
|
NETBSD32TOP_UAP(arg, void);
|
2001-02-04 12:00:14 +03:00
|
|
|
/* we can do this because `struct flock' doesn't change */
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_fcntl(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_dup2(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_dup2_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) from;
|
|
|
|
syscallarg(int) to;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_dup2_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(from);
|
|
|
|
NETBSD32TO64_UAP(to);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_dup2(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_fsync(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_fsync_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fsync_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_fsync(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setpriority(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setpriority_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) which;
|
|
|
|
syscallarg(int) who;
|
|
|
|
syscallarg(int) prio;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setpriority_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(which);
|
|
|
|
NETBSD32TO64_UAP(who);
|
|
|
|
NETBSD32TO64_UAP(prio);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_setpriority(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_socket(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_socket_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) domain;
|
|
|
|
syscallarg(int) type;
|
|
|
|
syscallarg(int) protocol;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_socket_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(domain);
|
|
|
|
NETBSD32TO64_UAP(type);
|
|
|
|
NETBSD32TO64_UAP(protocol);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_socket(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_connect(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_connect_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_sockaddrp_t) name;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) namelen;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_connect_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TOP_UAP(name, struct sockaddr);
|
|
|
|
NETBSD32TO64_UAP(namelen);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_connect(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_getpriority(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_getpriority_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) which;
|
|
|
|
syscallarg(int) who;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_getpriority_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(which);
|
|
|
|
NETBSD32TO64_UAP(who);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_getpriority(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_bind(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_bind_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_sockaddrp_t) name;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) namelen;
|
|
|
|
} */ *uap = v;
|
1998-10-01 18:27:56 +04:00
|
|
|
struct sys_bind_args ua;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TOP_UAP(name, struct sockaddr);
|
|
|
|
NETBSD32TO64_UAP(namelen);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_bind(p, &ua, retval));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setsockopt(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setsockopt_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
|
|
|
syscallarg(int) level;
|
|
|
|
syscallarg(int) name;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_voidp) val;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) valsize;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setsockopt_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TO64_UAP(level);
|
|
|
|
NETBSD32TO64_UAP(name);
|
|
|
|
NETBSD32TOP_UAP(val, void);
|
|
|
|
NETBSD32TO64_UAP(valsize);
|
1998-10-01 18:27:56 +04:00
|
|
|
/* may be more efficient to do this inline. */
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_setsockopt(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_listen(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_listen_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) s;
|
|
|
|
syscallarg(int) backlog;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_listen_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TO64_UAP(backlog);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_listen(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
2001-02-08 16:19:33 +03:00
|
|
|
netbsd32_fchown(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
2001-02-08 16:19:33 +03:00
|
|
|
struct netbsd32_fchown_args /* {
|
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(uid_t) uid;
|
|
|
|
syscallarg(gid_t) gid;
|
1998-10-01 18:27:56 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fchown_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(uid);
|
|
|
|
NETBSD32TO64_UAP(gid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_fchown(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_fchmod(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_fchmod_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(mode_t) mode;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fchmod_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(mode);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_fchmod(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setreuid(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setreuid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(uid_t) ruid;
|
|
|
|
syscallarg(uid_t) euid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setreuid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(ruid);
|
|
|
|
NETBSD32TO64_UAP(euid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_setreuid(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setregid(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setregid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(gid_t) rgid;
|
|
|
|
syscallarg(gid_t) egid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setregid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(rgid);
|
|
|
|
NETBSD32TO64_UAP(egid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_setregid(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_getsockopt(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_getsockopt_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
|
|
|
syscallarg(int) level;
|
|
|
|
syscallarg(int) name;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) val;
|
|
|
|
syscallarg(netbsd32_intp) avalsize;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_getsockopt_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TO64_UAP(level);
|
|
|
|
NETBSD32TO64_UAP(name);
|
|
|
|
NETBSD32TOP_UAP(val, void);
|
|
|
|
NETBSD32TOP_UAP(avalsize, int);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_getsockopt(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_rename(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_rename_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) from;
|
|
|
|
syscallarg(const netbsd32_charp) to;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_rename_args ua;
|
|
|
|
|
1999-12-30 18:40:45 +03:00
|
|
|
NETBSD32TOP_UAP(from, const char);
|
|
|
|
NETBSD32TOP_UAP(to, const char)
|
1998-10-01 18:27:56 +04:00
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_rename(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_flock(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_flock_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(int) how;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_flock_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(how)
|
1998-10-01 18:27:56 +04:00
|
|
|
|
|
|
|
return (sys_flock(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_mkfifo(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_mkfifo_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(mode_t) mode;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_mkfifo_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char)
|
|
|
|
NETBSD32TO64_UAP(mode);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_mkfifo(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_shutdown(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_shutdown_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) s;
|
|
|
|
syscallarg(int) how;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_shutdown_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s)
|
|
|
|
NETBSD32TO64_UAP(how);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_shutdown(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_socketpair(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_socketpair_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) domain;
|
|
|
|
syscallarg(int) type;
|
|
|
|
syscallarg(int) protocol;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_intp) rsv;
|
1998-10-01 18:27:56 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_socketpair_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(domain);
|
|
|
|
NETBSD32TO64_UAP(type);
|
|
|
|
NETBSD32TO64_UAP(protocol);
|
|
|
|
NETBSD32TOP_UAP(rsv, int);
|
1998-10-01 18:27:56 +04:00
|
|
|
/* Since we're just copying out two `int's we can do this */
|
|
|
|
return (sys_socketpair(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_mkdir(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_mkdir_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(mode_t) mode;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_mkdir_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char)
|
|
|
|
NETBSD32TO64_UAP(mode);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_mkdir(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_rmdir(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_rmdir_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_rmdir_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_rmdir(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_quotactl(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_quotactl_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) cmd;
|
|
|
|
syscallarg(int) uid;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) arg;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_quotactl_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(cmd);
|
|
|
|
NETBSD32TO64_UAP(uid);
|
|
|
|
NETBSD32TOX64_UAP(arg, caddr_t);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_quotactl(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
#if defined(NFS) || defined(NFSSERVER)
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_nfssvc(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1998-10-01 18:27:56 +04:00
|
|
|
#if 0
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_nfssvc_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) flag;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) argp;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_nfssvc_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(flag);
|
|
|
|
NETBSD32TOP_UAP(argp, void);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_nfssvc(p, &ua, retval));
|
1998-10-01 18:27:56 +04:00
|
|
|
#else
|
|
|
|
/* Why would we want to support a 32-bit nfsd? */
|
|
|
|
return (ENOSYS);
|
|
|
|
#endif
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
1998-10-01 18:27:56 +04:00
|
|
|
#endif
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
#if defined(NFS) || defined(NFSSERVER)
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_getfh(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_getfh_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) fname;
|
|
|
|
syscallarg(netbsd32_fhandlep_t) fhp;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_getfh_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(fname, const char);
|
|
|
|
NETBSD32TOP_UAP(fhp, struct fhandle);
|
1998-10-01 18:27:56 +04:00
|
|
|
/* Lucky for us a fhandlep_t doesn't change sizes */
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_getfh(p, &ua, retval));
|
|
|
|
}
|
1998-10-01 18:27:56 +04:00
|
|
|
#endif
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_pread(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_pread_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) buf;
|
|
|
|
syscallarg(netbsd32_size_t) nbyte;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) pad;
|
|
|
|
syscallarg(off_t) offset;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_pread_args ua;
|
|
|
|
ssize_t rt;
|
|
|
|
int error;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TOP_UAP(buf, void);
|
|
|
|
NETBSD32TOX_UAP(nbyte, size_t);
|
|
|
|
NETBSD32TO64_UAP(pad);
|
|
|
|
NETBSD32TO64_UAP(offset);
|
1998-08-26 14:20:33 +04:00
|
|
|
error = sys_pread(p, &ua, (register_t *)&rt);
|
2000-07-09 17:39:31 +04:00
|
|
|
*retval = rt;
|
1998-08-26 14:20:33 +04:00
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_pwrite(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_pwrite_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_voidp) buf;
|
|
|
|
syscallarg(netbsd32_size_t) nbyte;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) pad;
|
|
|
|
syscallarg(off_t) offset;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_pwrite_args ua;
|
|
|
|
ssize_t rt;
|
|
|
|
int error;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TOP_UAP(buf, void);
|
|
|
|
NETBSD32TOX_UAP(nbyte, size_t);
|
|
|
|
NETBSD32TO64_UAP(pad);
|
|
|
|
NETBSD32TO64_UAP(offset);
|
1998-08-26 14:20:33 +04:00
|
|
|
error = sys_pwrite(p, &ua, (register_t *)&rt);
|
2000-07-09 17:39:31 +04:00
|
|
|
*retval = rt;
|
1998-08-26 14:20:33 +04:00
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setgid(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setgid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(gid_t) gid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setgid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(gid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_setgid(p, v, retval));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setegid(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setegid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(gid_t) egid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_setegid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(egid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_setegid(p, v, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_seteuid(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_seteuid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(gid_t) euid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_seteuid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(euid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_seteuid(p, v, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef LFS
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_sys_lfs_bmapv(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
|
|
|
|
|
|
|
return (ENOSYS); /* XXX */
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_sys_lfs_markv(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
|
|
|
|
|
|
|
return (ENOSYS); /* XXX */
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_sys_lfs_segclean(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-12-30 18:40:45 +03:00
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
return (ENOSYS); /* XXX */
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_sys_lfs_segwait(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-12-30 18:40:45 +03:00
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
return (ENOSYS); /* XXX */
|
|
|
|
}
|
1998-10-01 18:27:56 +04:00
|
|
|
#endif
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_pathconf(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_pathconf_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(int) name;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_pathconf_args ua;
|
|
|
|
long rt;
|
|
|
|
int error;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(name);
|
1998-08-26 14:20:33 +04:00
|
|
|
error = sys_pathconf(p, &ua, (register_t *)&rt);
|
2000-07-09 17:39:31 +04:00
|
|
|
*retval = rt;
|
1998-08-26 14:20:33 +04:00
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_fpathconf(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_fpathconf_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(int) name;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fpathconf_args ua;
|
|
|
|
long rt;
|
|
|
|
int error;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(name);
|
1998-08-26 14:20:33 +04:00
|
|
|
error = sys_fpathconf(p, &ua, (register_t *)&rt);
|
2000-07-09 17:39:31 +04:00
|
|
|
*retval = rt;
|
1998-08-26 14:20:33 +04:00
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_getrlimit(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_getrlimit_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) which;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_rlimitp_t) rlp;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
1998-10-01 18:27:56 +04:00
|
|
|
int which = SCARG(uap, which);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
if ((u_int)which >= RLIM_NLIMITS)
|
|
|
|
return (EINVAL);
|
|
|
|
return (copyout(&p->p_rlimit[which], (caddr_t)(u_long)SCARG(uap, rlp),
|
|
|
|
sizeof(struct rlimit)));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_setrlimit(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_setrlimit_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) which;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_rlimitp_t) rlp;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
1998-10-01 18:27:56 +04:00
|
|
|
int which = SCARG(uap, which);
|
|
|
|
struct rlimit alim;
|
|
|
|
int error;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
error = copyin((caddr_t)(u_long)SCARG(uap, rlp), &alim, sizeof(struct rlimit));
|
|
|
|
if (error)
|
|
|
|
return (error);
|
1999-09-28 18:47:00 +04:00
|
|
|
return (dosetrlimit(p, p->p_cred, which, &alim));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_mmap(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_mmap_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) prot;
|
|
|
|
syscallarg(int) flags;
|
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_long) pad;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(off_t) pos;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_mmap_args ua;
|
|
|
|
void *rt;
|
|
|
|
int error;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(addr, void);
|
|
|
|
NETBSD32TOX_UAP(len, size_t);
|
|
|
|
NETBSD32TO64_UAP(prot);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TOX_UAP(pad, long);
|
|
|
|
NETBSD32TOX_UAP(pos, off_t);
|
1998-08-26 14:20:33 +04:00
|
|
|
error = sys_mmap(p, &ua, (register_t *)&rt);
|
2001-02-06 20:01:51 +03:00
|
|
|
if ((u_long)rt > (u_long)UINT_MAX) {
|
2000-12-02 00:48:24 +03:00
|
|
|
printf("netbsd32_mmap: retval out of range: %p", rt);
|
2001-02-06 20:01:51 +03:00
|
|
|
/* Should try to recover and return an error here. */
|
|
|
|
}
|
1999-03-25 19:22:49 +03:00
|
|
|
*retval = (netbsd32_voidp)(u_long)rt;
|
1998-08-26 14:20:33 +04:00
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_lseek(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_lseek_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(int) pad;
|
|
|
|
syscallarg(off_t) offset;
|
|
|
|
syscallarg(int) whence;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_lseek_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(pad);
|
|
|
|
NETBSD32TO64_UAP(offset);
|
|
|
|
NETBSD32TO64_UAP(whence);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_lseek(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_truncate(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_truncate_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) pad;
|
|
|
|
syscallarg(off_t) length;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_truncate_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(pad);
|
|
|
|
NETBSD32TO64_UAP(length);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_truncate(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_ftruncate(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_ftruncate_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(int) pad;
|
|
|
|
syscallarg(off_t) length;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_ftruncate_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(pad);
|
|
|
|
NETBSD32TO64_UAP(length);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_ftruncate(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
2001-02-04 09:35:07 +03:00
|
|
|
int
|
2001-02-08 16:19:33 +03:00
|
|
|
netbsd32_mlock(p, v, retval)
|
2001-02-04 09:35:07 +03:00
|
|
|
struct proc *p;
|
2001-02-08 16:19:33 +03:00
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
2001-02-04 09:35:07 +03:00
|
|
|
{
|
2001-02-08 16:19:33 +03:00
|
|
|
struct netbsd32_mlock_args /* {
|
|
|
|
syscallarg(const netbsd32_voidp) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_mlock_args ua;
|
2001-02-04 09:35:07 +03:00
|
|
|
|
2001-02-08 16:19:33 +03:00
|
|
|
NETBSD32TOP_UAP(addr, const void);
|
|
|
|
NETBSD32TO64_UAP(len);
|
|
|
|
return (sys_mlock(p, &ua, retval));
|
2001-02-04 09:35:07 +03:00
|
|
|
}
|
|
|
|
|
2001-02-04 10:08:51 +03:00
|
|
|
int
|
2001-02-08 16:19:33 +03:00
|
|
|
netbsd32_munlock(p, v, retval)
|
2001-02-04 10:08:51 +03:00
|
|
|
struct proc *p;
|
2001-02-08 16:19:33 +03:00
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
2001-02-04 10:08:51 +03:00
|
|
|
{
|
2001-02-08 16:19:33 +03:00
|
|
|
struct netbsd32_munlock_args /* {
|
|
|
|
syscallarg(const netbsd32_voidp) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_munlock_args ua;
|
2001-02-04 10:08:51 +03:00
|
|
|
|
2001-02-08 16:19:33 +03:00
|
|
|
NETBSD32TOP_UAP(addr, const void);
|
|
|
|
NETBSD32TO64_UAP(len);
|
|
|
|
return (sys_munlock(p, &ua, retval));
|
2001-02-04 10:08:51 +03:00
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
2001-02-08 16:19:33 +03:00
|
|
|
netbsd32_undelete(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_undelete_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_undelete_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_undelete(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_getpgid(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_getpgid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(pid_t) pid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_getpgid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(pid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_getpgid(p, &ua, retval));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_reboot(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_reboot_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) opt;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_charp) bootstr;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_reboot_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(opt);
|
|
|
|
NETBSD32TOP_UAP(bootstr, char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_reboot(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_poll(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_poll_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_pollfdp_t) fds;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(u_int) nfds;
|
|
|
|
syscallarg(int) timeout;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_poll_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(fds, struct pollfd);
|
|
|
|
NETBSD32TO64_UAP(nfds);
|
|
|
|
NETBSD32TO64_UAP(timeout);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_poll(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_fdatasync(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_fdatasync_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fdatasync_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_fdatasync(p, &ua, retval));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32___posix_rename(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32___posix_rename_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) from;
|
|
|
|
syscallarg(const netbsd32_charp) to;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys___posix_rename_args ua;
|
|
|
|
|
1999-12-30 18:40:45 +03:00
|
|
|
NETBSD32TOP_UAP(from, const char);
|
|
|
|
NETBSD32TOP_UAP(to, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys___posix_rename(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_swapctl(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_swapctl_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) cmd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_voidp) arg;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) misc;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_swapctl_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(cmd);
|
|
|
|
NETBSD32TOP_UAP(arg, const void);
|
|
|
|
NETBSD32TO64_UAP(misc);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_swapctl(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_minherit(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_minherit_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) inherit;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_minherit_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(addr, void);
|
|
|
|
NETBSD32TOX_UAP(len, size_t);
|
|
|
|
NETBSD32TO64_UAP(inherit);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_minherit(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_lchmod(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_lchmod_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(mode_t) mode;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_lchmod_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(mode);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_lchmod(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_lchown(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_lchown_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(uid_t) uid;
|
|
|
|
syscallarg(gid_t) gid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_lchown_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(uid);
|
|
|
|
NETBSD32TO64_UAP(gid);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_lchown(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32___msync13(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32___msync13_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_voidp) addr;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) flags;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys___msync13_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(addr, void);
|
|
|
|
NETBSD32TOX_UAP(len, size_t);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys___msync13(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32___posix_chown(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32___posix_chown_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(uid_t) uid;
|
|
|
|
syscallarg(gid_t) gid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys___posix_chown_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(uid);
|
|
|
|
NETBSD32TO64_UAP(gid);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys___posix_chown(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32___posix_fchown(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32___posix_fchown_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(uid_t) uid;
|
|
|
|
syscallarg(gid_t) gid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys___posix_fchown_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(uid);
|
|
|
|
NETBSD32TO64_UAP(gid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys___posix_fchown(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32___posix_lchown(p, v, retval)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32___posix_lchown_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(uid_t) uid;
|
|
|
|
syscallarg(gid_t) gid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys___posix_lchown_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(uid);
|
|
|
|
NETBSD32TO64_UAP(gid);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys___posix_lchown(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_getsid(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_getsid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(pid_t) pid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_getsid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(pid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_getsid(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
2000-12-02 00:48:24 +03:00
|
|
|
#ifdef KTRACE
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_fktrace(p, v, retval)
|
1998-10-01 18:27:56 +04:00
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_fktrace_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(const int) fd;
|
|
|
|
syscallarg(int) ops;
|
|
|
|
syscallarg(int) facs;
|
|
|
|
syscallarg(int) pid;
|
|
|
|
} */ *uap = v;
|
2000-12-03 17:48:29 +03:00
|
|
|
#if 0
|
1998-10-01 18:27:56 +04:00
|
|
|
struct sys_fktrace_args ua;
|
2000-12-03 17:48:29 +03:00
|
|
|
#else
|
|
|
|
/* XXXX */
|
|
|
|
struct sys_fktrace_noconst_args {
|
|
|
|
syscallarg(int) fd;
|
|
|
|
syscallarg(int) ops;
|
|
|
|
syscallarg(int) facs;
|
|
|
|
syscallarg(int) pid;
|
|
|
|
} ua;
|
|
|
|
#endif
|
1998-10-01 18:27:56 +04:00
|
|
|
|
2000-07-09 17:39:31 +04:00
|
|
|
NETBSD32TOX_UAP(fd, int);
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(ops);
|
|
|
|
NETBSD32TO64_UAP(facs);
|
|
|
|
NETBSD32TO64_UAP(pid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_fktrace(p, &ua, retval));
|
|
|
|
}
|
2000-12-02 00:48:24 +03:00
|
|
|
#endif /* KTRACE */
|
1998-10-01 18:27:56 +04:00
|
|
|
|
1999-12-30 18:40:45 +03:00
|
|
|
int netbsd32___sigpending14(p, v, retval)
|
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
2000-03-30 15:24:16 +04:00
|
|
|
struct netbsd32___sigpending14_args /* {
|
1999-12-30 18:40:45 +03:00
|
|
|
syscallarg(sigset_t *) set;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys___sigpending14_args ua;
|
|
|
|
|
|
|
|
NETBSD32TOP_UAP(set, sigset_t);
|
|
|
|
return (sys___sigpending14(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int netbsd32___sigprocmask14(p, v, retval)
|
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
2000-03-30 15:24:16 +04:00
|
|
|
struct netbsd32___sigprocmask14_args /* {
|
1999-12-30 18:40:45 +03:00
|
|
|
syscallarg(int) how;
|
|
|
|
syscallarg(const sigset_t *) set;
|
|
|
|
syscallarg(sigset_t *) oset;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys___sigprocmask14_args ua;
|
|
|
|
|
|
|
|
NETBSD32TO64_UAP(how);
|
|
|
|
NETBSD32TOP_UAP(set, sigset_t);
|
|
|
|
NETBSD32TOP_UAP(oset, sigset_t);
|
|
|
|
return (sys___sigprocmask14(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int netbsd32___sigsuspend14(p, v, retval)
|
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
|
|
|
struct netbsd32___sigsuspend14_args /* {
|
|
|
|
syscallarg(const sigset_t *) set;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys___sigsuspend14_args ua;
|
|
|
|
|
|
|
|
NETBSD32TOP_UAP(set, sigset_t);
|
|
|
|
return (sys___sigsuspend14(p, &ua, retval));
|
|
|
|
};
|
|
|
|
|
|
|
|
int netbsd32_fchroot(p, v, retval)
|
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
2000-03-30 15:24:16 +04:00
|
|
|
struct netbsd32_fchroot_args /* {
|
1999-12-30 18:40:45 +03:00
|
|
|
syscallarg(int) fd;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fchroot_args ua;
|
|
|
|
|
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
return (sys_fchroot(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Open a file given a file handle.
|
|
|
|
*
|
|
|
|
* Check permissions, allocate an open file structure,
|
|
|
|
* and call the device open routine if any.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
netbsd32_fhopen(p, v, retval)
|
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
2000-03-30 15:24:16 +04:00
|
|
|
struct netbsd32_fhopen_args /* {
|
1999-12-30 18:40:45 +03:00
|
|
|
syscallarg(const fhandle_t *) fhp;
|
|
|
|
syscallarg(int) flags;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fhopen_args ua;
|
|
|
|
|
|
|
|
NETBSD32TOP_UAP(fhp, fhandle_t);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
|
|
|
return (sys_fhopen(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int netbsd32_fhstat(p, v, retval)
|
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
2000-03-30 15:24:16 +04:00
|
|
|
struct netbsd32_fhstat_args /* {
|
1999-12-30 18:40:45 +03:00
|
|
|
syscallarg(const netbsd32_fhandlep_t) fhp;
|
|
|
|
syscallarg(struct stat *) sb;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_fhstat_args ua;
|
|
|
|
|
|
|
|
NETBSD32TOP_UAP(fhp, const fhandle_t);
|
|
|
|
NETBSD32TOP_UAP(sb, struct stat);
|
|
|
|
return (sys_fhstat(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int netbsd32_fhstatfs(p, v, retval)
|
|
|
|
struct proc *p;
|
1998-10-01 18:27:56 +04:00
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
2000-03-30 15:24:16 +04:00
|
|
|
struct netbsd32_fhstatfs_args /* {
|
1999-12-30 18:40:45 +03:00
|
|
|
syscallarg(const netbsd32_fhandlep_t) fhp;
|
|
|
|
syscallarg(struct statfs *) buf;
|
1998-10-01 18:27:56 +04:00
|
|
|
} */ *uap = v;
|
1999-12-30 18:40:45 +03:00
|
|
|
struct sys_fhstatfs_args ua;
|
1998-10-01 18:27:56 +04:00
|
|
|
|
1999-12-30 18:40:45 +03:00
|
|
|
NETBSD32TOP_UAP(fhp, const fhandle_t);
|
|
|
|
NETBSD32TOP_UAP(buf, struct statfs);
|
|
|
|
return (sys_fhstatfs(p, &ua, retval));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
2000-09-24 17:09:31 +04:00
|
|
|
|
|
|
|
/* virtual memory syscalls */
|
|
|
|
int
|
|
|
|
netbsd32_ovadvise(p, v, retval)
|
|
|
|
struct proc *p;
|
|
|
|
void *v;
|
|
|
|
register_t *retval;
|
|
|
|
{
|
|
|
|
struct netbsd32_ovadvise_args /* {
|
|
|
|
syscallarg(int) anom;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_ovadvise_args ua;
|
|
|
|
|
|
|
|
NETBSD32TO64_UAP(anom);
|
|
|
|
return (sys_ovadvise(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|