1999-12-30 18:40:45 +03:00
|
|
|
/* $NetBSD: netbsd32_compat_43.c,v 1.9 1999/12/30 15:40:45 eeh Exp $ */
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1998 Matthew R. Green
|
|
|
|
* 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,
|
1999-04-14 06:50:38 +04:00
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
1998-08-26 14:20:33 +04:00
|
|
|
* 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,
|
1999-04-14 06:50:38 +04:00
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
1998-08-26 14:20:33 +04:00
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/fcntl.h>
|
|
|
|
#include <sys/malloc.h>
|
|
|
|
#include <sys/mount.h>
|
|
|
|
#include <sys/proc.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/syscallargs.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <sys/ucred.h>
|
|
|
|
#include <vm/vm.h> /* XXX for <sys/sysctl.h> */
|
|
|
|
#include <sys/sysctl.h>
|
1998-08-29 21:01:14 +04:00
|
|
|
#include <sys/swap.h>
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
#include <compat/netbsd32/netbsd32.h>
|
|
|
|
#include <compat/netbsd32/netbsd32_syscallargs.h>
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1999-12-30 18:40:45 +03:00
|
|
|
static void netbsd32_from_stat43 __P((struct stat43 *, struct netbsd32_stat43 *));
|
|
|
|
int compat_43_netbsd32_sethostid __P((struct proc *, void *, register_t *));
|
|
|
|
int compat_43_netbsd32_killpg __P((struct proc *, void *, register_t *retval));
|
|
|
|
int compat_43_netbsd32_sigblock __P((struct proc *, void *, register_t *retval));
|
|
|
|
int compat_43_netbsd32_sigblock __P((struct proc *, void *, register_t *retval));
|
|
|
|
|
|
|
|
static void
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_from_stat43(sp43, sp32)
|
1998-08-26 14:20:33 +04:00
|
|
|
struct stat43 *sp43;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_stat43 *sp32;
|
1998-08-26 14:20:33 +04:00
|
|
|
{
|
|
|
|
|
|
|
|
sp32->st_dev = sp43->st_dev;
|
|
|
|
sp32->st_ino = sp43->st_ino;
|
|
|
|
sp32->st_mode = sp43->st_mode;
|
|
|
|
sp32->st_nlink = sp43->st_nlink;
|
|
|
|
sp32->st_uid = sp43->st_uid;
|
|
|
|
sp32->st_gid = sp43->st_gid;
|
|
|
|
sp32->st_rdev = sp43->st_rdev;
|
|
|
|
sp32->st_size = sp43->st_size;
|
|
|
|
sp32->st_atimespec.tv_sec = sp43->st_atimespec.tv_sec;
|
|
|
|
sp32->st_atimespec.tv_nsec = sp43->st_atimespec.tv_nsec;
|
|
|
|
sp32->st_mtimespec.tv_sec = sp43->st_mtimespec.tv_sec;
|
|
|
|
sp32->st_mtimespec.tv_nsec = sp43->st_mtimespec.tv_nsec;
|
|
|
|
sp32->st_ctimespec.tv_sec = sp43->st_ctimespec.tv_sec;
|
|
|
|
sp32->st_ctimespec.tv_nsec = sp43->st_ctimespec.tv_nsec;
|
|
|
|
sp32->st_blksize = sp43->st_blksize;
|
|
|
|
sp32->st_blocks = sp43->st_blocks;
|
|
|
|
sp32->st_flags = sp43->st_flags;
|
|
|
|
sp32->st_gen = sp43->st_gen;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* file system syscalls */
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_ocreat(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 compat_43_netbsd32_ocreat_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_open_args ua;
|
|
|
|
caddr_t sg;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(mode);
|
1998-08-26 14:20:33 +04:00
|
|
|
SCARG(&ua, flags) = O_WRONLY | O_CREAT | O_TRUNC;
|
|
|
|
sg = stackgap_init(p->p_emul);
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32_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
|
|
|
compat_43_netbsd32_olseek(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 compat_43_netbsd32_olseek_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_long) offset;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) whence;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_lseek_args ua;
|
|
|
|
int rv;
|
|
|
|
off_t rt;
|
|
|
|
|
|
|
|
SCARG(&ua, fd) = SCARG(uap, fd);
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOX_UAP(offset, long);
|
|
|
|
NETBSD32TO64_UAP(whence);
|
1998-08-26 14:20:33 +04:00
|
|
|
rv = sys_lseek(p, &ua, (register_t *)&rt);
|
1999-03-25 19:22:49 +03:00
|
|
|
*(netbsd32_long *)retval = rt;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (rv);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_stat43(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 compat_43_netbsd32_stat43_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
|
|
|
syscallarg(netbsd32_stat43p_t) ub;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_stat43 *sp32;
|
1998-08-26 14:20:33 +04:00
|
|
|
struct stat43 sb43;
|
|
|
|
struct stat43 *sp43 = &sb43;
|
|
|
|
struct compat_43_sys_stat_args ua;
|
|
|
|
caddr_t sg;
|
|
|
|
int rv;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
SCARG(&ua, ub) = &sb43;
|
|
|
|
sg = stackgap_init(p->p_emul);
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
rv = compat_43_sys_stat(p, &ua, retval);
|
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
sp32 = (struct netbsd32_stat43 *)(u_long)SCARG(uap, ub);
|
|
|
|
netbsd32_from_stat43(sp43, sp32);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (rv);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_lstat43(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 compat_43_netbsd32_lstat43_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
|
|
|
syscallarg(netbsd32_stat43p_t) ub;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_stat43 *sp32;
|
1998-08-26 14:20:33 +04:00
|
|
|
struct stat43 sb43;
|
|
|
|
struct stat43 *sp43 = &sb43;
|
|
|
|
struct compat_43_sys_lstat_args ua;
|
|
|
|
caddr_t sg;
|
|
|
|
int rv;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
1998-08-26 14:20:33 +04:00
|
|
|
SCARG(&ua, ub) = &sb43;
|
|
|
|
sg = stackgap_init(p->p_emul);
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
rv = compat_43_sys_stat(p, &ua, retval);
|
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
sp32 = (struct netbsd32_stat43 *)(u_long)SCARG(uap, ub);
|
|
|
|
netbsd32_from_stat43(sp43, sp32);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (rv);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_fstat43(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 compat_43_netbsd32_fstat43_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_stat43p_t) sb;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_stat43 *sp32;
|
1998-08-26 14:20:33 +04:00
|
|
|
struct stat43 sb43;
|
|
|
|
struct stat43 *sp43 = &sb43;
|
|
|
|
struct compat_43_sys_fstat_args ua;
|
|
|
|
int rv;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
1998-08-26 14:20:33 +04:00
|
|
|
SCARG(&ua, sb) = &sb43;
|
|
|
|
rv = compat_43_sys_fstat(p, &ua, retval);
|
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
sp32 = (struct netbsd32_stat43 *)(u_long)SCARG(uap, sb);
|
|
|
|
netbsd32_from_stat43(sp43, sp32);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
return (rv);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_otruncate(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 compat_43_netbsd32_otruncate_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(const netbsd32_charp) path;
|
|
|
|
syscallarg(netbsd32_long) length;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_truncate_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOP_UAP(path, const char);
|
|
|
|
NETBSD32TO64_UAP(length);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_ftruncate(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_oftruncate(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 compat_43_netbsd32_oftruncate_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_long) length;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_ftruncate_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TO64_UAP(length);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (sys_ftruncate(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_ogetdirentries(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 compat_43_netbsd32_ogetdirentries_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fd;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_charp) buf;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(u_int) count;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_longp) basep;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_getdirentries_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TOP_UAP(buf, char);
|
|
|
|
NETBSD32TO64_UAP(count);
|
|
|
|
NETBSD32TOP_UAP(basep, long);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (compat_43_sys_getdirentries(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* kernel syscalls */
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_ogetkerninfo(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 compat_43_netbsd32_ogetkerninfo_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) op;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_charp) where;
|
|
|
|
syscallarg(netbsd32_intp) size;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) arg;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_getkerninfo_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(op);
|
|
|
|
NETBSD32TOP_UAP(where, char);
|
|
|
|
NETBSD32TOP_UAP(size, int);
|
|
|
|
NETBSD32TO64_UAP(arg);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (compat_43_sys_getkerninfo(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_ogethostname(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 compat_43_netbsd32_ogethostname_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_charp) hostname;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(u_int) len;
|
|
|
|
} */ *uap = v;
|
|
|
|
int name;
|
|
|
|
size_t sz;
|
|
|
|
|
|
|
|
name = KERN_HOSTNAME;
|
|
|
|
sz = SCARG(uap, len);
|
|
|
|
return (kern_sysctl(&name, 1, (char *)(u_long)SCARG(uap, hostname),
|
|
|
|
&sz, 0, 0, p));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_osethostname(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 compat_43_netbsd32_osethostname_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_charp) hostname;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(u_int) len;
|
|
|
|
} */ *uap = v;
|
|
|
|
int name;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
|
|
|
|
return (error);
|
|
|
|
name = KERN_HOSTNAME;
|
|
|
|
return (kern_sysctl(&name, 1, 0, 0, (char *)(u_long)SCARG(uap,
|
|
|
|
hostname), SCARG(uap, len), p));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_sethostid(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 compat_43_netbsd32_sethostid_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int32_t) hostid;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_sethostid_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(hostid);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (compat_43_sys_sethostid(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_ogetrlimit(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 compat_43_netbsd32_ogetrlimit_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) which;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_orlimitp_t) rlp;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_getrlimit_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(which);
|
|
|
|
NETBSD32TOP_UAP(rlp, struct orlimit);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (compat_43_sys_getrlimit(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_osetrlimit(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 compat_43_netbsd32_osetrlimit_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) which;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_orlimitp_t) rlp;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_setrlimit_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(which);
|
|
|
|
NETBSD32TOP_UAP(rlp, struct orlimit);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (compat_43_sys_setrlimit(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_killpg(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 compat_43_netbsd32_killpg_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) pgid;
|
|
|
|
syscallarg(int) signum;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_killpg_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(pgid);
|
|
|
|
NETBSD32TO64_UAP(signum);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (compat_43_sys_killpg(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
/* virtual memory syscalls */
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_ommap(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 compat_43_netbsd32_ommap_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) 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) pos;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_mmap_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOX64_UAP(addr, caddr_t);
|
|
|
|
NETBSD32TOX_UAP(len, size_t);
|
|
|
|
NETBSD32TO64_UAP(prot);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
|
|
|
NETBSD32TO64_UAP(fd);
|
|
|
|
NETBSD32TOX_UAP(pos, long);
|
1998-08-26 17:38:21 +04:00
|
|
|
return (compat_43_sys_mmap(p, &ua, retval));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
/* virtual memory syscalls */
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_ovadvise(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_ovadvise_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) anom;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct sys_ovadvise_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(anom);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (sys_ovadvise(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
/* network syscalls */
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_oaccept(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 compat_43_netbsd32_oaccept_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) name;
|
|
|
|
syscallarg(netbsd32_intp) anamelen;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_accept_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TOX_UAP(s, int);
|
|
|
|
NETBSD32TOX64_UAP(name, caddr_t);
|
|
|
|
NETBSD32TOP_UAP(anamelen, int);
|
1998-08-26 17:38:21 +04:00
|
|
|
return (compat_43_sys_accept(p, &ua, retval));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_osend(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 compat_43_netbsd32_osend_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) buf;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) len;
|
|
|
|
syscallarg(int) flags;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_send_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TOX64_UAP(buf, caddr_t);
|
|
|
|
NETBSD32TO64_UAP(len);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
1998-08-26 17:38:21 +04:00
|
|
|
return (compat_43_sys_send(p, &ua, retval));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_orecv(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 compat_43_netbsd32_orecv_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) buf;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) len;
|
|
|
|
syscallarg(int) flags;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_recv_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TOX64_UAP(buf, caddr_t);
|
|
|
|
NETBSD32TO64_UAP(len);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
1998-08-26 17:38:21 +04:00
|
|
|
return (compat_43_sys_recv(p, &ua, retval));
|
1998-08-26 14:20:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX convert these to use a common iovec code to the native
|
|
|
|
* netbsd call.
|
|
|
|
*/
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_orecvmsg(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 compat_43_netbsd32_orecvmsg_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_omsghdrp_t) msg;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) flags;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_recvmsg_args ua;
|
|
|
|
struct omsghdr omh;
|
|
|
|
struct omsghdr *omhp = &omh;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_omsghdr *omhp32;
|
1998-08-26 14:20:33 +04:00
|
|
|
struct iovec *iovec43p;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_iovec *iovec32p;
|
1998-08-26 14:20:33 +04:00
|
|
|
int i;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
SCARG(&ua, msg) = omhp;
|
1999-03-25 19:22:49 +03:00
|
|
|
omhp32 = (struct netbsd32_omsghdr *)(u_long)SCARG(uap, msg);
|
1998-08-26 14:20:33 +04:00
|
|
|
omhp->msg_name = (caddr_t)(u_long)omhp32->msg_name;
|
|
|
|
omhp->msg_namelen = omhp32->msg_namelen;
|
|
|
|
omhp->msg_iovlen = (size_t)omhp32->msg_iovlen;
|
|
|
|
MALLOC(omhp->msg_iov, struct iovec *, sizeof(struct iovec) * omhp->msg_iovlen, M_TEMP, M_WAITOK);
|
|
|
|
iovec43p = omhp->msg_iov;
|
1999-03-25 19:22:49 +03:00
|
|
|
iovec32p = (struct netbsd32_iovec *)(u_long)omhp32->msg_iov;
|
1998-08-26 14:20:33 +04:00
|
|
|
for (i = 0; i < omhp->msg_iovlen; i++, iovec43p++, iovec32p++) {
|
|
|
|
iovec43p->iov_base = (struct iovec *)(u_long)iovec32p->iov_base;
|
|
|
|
iovec43p->iov_len = (size_t)iovec32p->iov_len;
|
|
|
|
}
|
|
|
|
|
|
|
|
omhp->msg_accrights = (caddr_t)(u_long)omhp32->msg_accrights;
|
|
|
|
omhp->msg_accrightslen = omhp32->msg_accrightslen;
|
|
|
|
|
|
|
|
return (compat_43_sys_recvmsg(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_osendmsg(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 compat_43_netbsd32_osendmsg_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) msg;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) flags;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_sendmsg_args ua;
|
|
|
|
struct omsghdr omh;
|
|
|
|
struct omsghdr *omhp = &omh;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_omsghdr *omhp32;
|
1998-08-26 14:20:33 +04:00
|
|
|
struct iovec *iovec43p;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_iovec *iovec32p;
|
1998-08-26 14:20:33 +04:00
|
|
|
int i;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
SCARG(&ua, msg) = (caddr_t)(u_long)omhp;
|
1999-03-25 19:22:49 +03:00
|
|
|
omhp32 = (struct netbsd32_omsghdr *)(u_long)SCARG(uap, msg);
|
1998-08-26 14:20:33 +04:00
|
|
|
omhp->msg_name = (caddr_t)(u_long)omhp32->msg_name;
|
|
|
|
omhp->msg_namelen = omhp32->msg_namelen;
|
|
|
|
omhp->msg_iovlen = (size_t)omhp32->msg_iovlen;
|
|
|
|
MALLOC(omhp->msg_iov, struct iovec *, sizeof(struct iovec) * omhp->msg_iovlen, M_TEMP, M_WAITOK);
|
|
|
|
iovec43p = omhp->msg_iov;
|
1999-03-25 19:22:49 +03:00
|
|
|
iovec32p = (struct netbsd32_iovec *)(u_long)omhp32->msg_iov;
|
1998-08-26 14:20:33 +04:00
|
|
|
for (i = 0; i < omhp->msg_iovlen; i++, iovec43p++, iovec32p++) {
|
|
|
|
iovec43p->iov_base = (void *)(u_long)iovec32p->iov_base;
|
|
|
|
iovec43p->iov_len = (size_t)iovec32p->iov_len;
|
|
|
|
}
|
|
|
|
|
|
|
|
omhp->msg_accrights = (caddr_t)(u_long)omhp32->msg_accrights;
|
|
|
|
omhp->msg_accrightslen = omhp32->msg_accrightslen;
|
|
|
|
|
|
|
|
return (compat_43_sys_sendmsg(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_orecvfrom(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 compat_43_netbsd32_orecvfrom_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) s;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) buf;
|
|
|
|
syscallarg(netbsd32_size_t) len;
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) flags;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) from;
|
|
|
|
syscallarg(netbsd32_intp) fromlenaddr;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_recvfrom_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(s);
|
|
|
|
NETBSD32TOX64_UAP(buf, caddr_t);
|
|
|
|
NETBSD32TOX_UAP(len, size_t);
|
|
|
|
NETBSD32TO64_UAP(flags);
|
|
|
|
NETBSD32TOX64_UAP(from, caddr_t);
|
|
|
|
NETBSD32TOP_UAP(fromlenaddr, int);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (compat_43_sys_recvfrom(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_ogetsockname(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 compat_43_netbsd32_ogetsockname_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fdec;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) asa;
|
|
|
|
syscallarg(netbsd32_intp) alen;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_getsockname_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fdec);
|
|
|
|
NETBSD32TOX64_UAP(asa, caddr_t);
|
|
|
|
NETBSD32TOP_UAP(alen, int);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (compat_43_sys_getsockname(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_ogetpeername(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 compat_43_netbsd32_ogetpeername_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) fdes;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_caddr_t) asa;
|
|
|
|
syscallarg(netbsd32_intp) alen;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_getpeername_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(fdes);
|
|
|
|
NETBSD32TOX64_UAP(asa, caddr_t);
|
|
|
|
NETBSD32TOP_UAP(alen, int);
|
1998-08-26 14:20:33 +04:00
|
|
|
return (compat_43_sys_getpeername(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* signal syscalls */
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_osigvec(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 compat_43_netbsd32_osigvec_args /* {
|
1998-08-26 14:20:33 +04:00
|
|
|
syscallarg(int) signum;
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_sigvecp_t) nsv;
|
|
|
|
syscallarg(netbsd32_sigvecp_t) osv;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_sigvec_args ua;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_sigvec *sv32p;
|
1998-08-26 14:20:33 +04:00
|
|
|
struct sigvec nsv, osv;
|
|
|
|
int rv;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(signum);
|
1998-08-26 14:20:33 +04:00
|
|
|
if (SCARG(uap, osv))
|
|
|
|
SCARG(&ua, osv) = &osv;
|
|
|
|
else
|
|
|
|
SCARG(&ua, osv) = NULL;
|
|
|
|
if (SCARG(uap, nsv)) {
|
|
|
|
SCARG(&ua, nsv) = &nsv;
|
1999-03-25 19:22:49 +03:00
|
|
|
sv32p = (struct netbsd32_sigvec *)(u_long)SCARG(uap, nsv);
|
1998-08-26 14:20:33 +04:00
|
|
|
nsv.sv_handler = (void *)(u_long)sv32p->sv_handler;
|
|
|
|
nsv.sv_mask = sv32p->sv_mask;
|
|
|
|
nsv.sv_flags = sv32p->sv_flags;
|
|
|
|
} else
|
|
|
|
SCARG(&ua, nsv) = NULL;
|
|
|
|
rv = compat_43_sys_sigvec(p, &ua, retval);
|
|
|
|
if (rv)
|
|
|
|
return (rv);
|
|
|
|
|
|
|
|
if (SCARG(uap, osv)) {
|
1999-03-25 19:22:49 +03:00
|
|
|
sv32p = (struct netbsd32_sigvec *)(u_long)SCARG(uap, osv);
|
|
|
|
sv32p->sv_handler = (netbsd32_sigvecp_t)(u_long)osv.sv_handler;
|
1998-08-26 14:20:33 +04:00
|
|
|
sv32p->sv_mask = osv.sv_mask;
|
|
|
|
sv32p->sv_flags = osv.sv_flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
1998-10-01 18:27:56 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_sigblock(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 compat_43_netbsd32_sigblock_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) mask;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_sigblock_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(mask);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (compat_43_sys_sigblock(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_sigsetmask(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 compat_43_netbsd32_sigsetmask_args /* {
|
1998-10-01 18:27:56 +04:00
|
|
|
syscallarg(int) mask;
|
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_sigsetmask_args ua;
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
NETBSD32TO64_UAP(mask);
|
1998-10-01 18:27:56 +04:00
|
|
|
return (compat_43_sys_sigsetmask(p, &ua, retval));
|
|
|
|
}
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
int
|
1999-10-11 05:36:21 +04:00
|
|
|
compat_43_netbsd32_osigstack(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 compat_43_netbsd32_osigstack_args /* {
|
1999-03-25 19:22:49 +03:00
|
|
|
syscallarg(netbsd32_sigstackp_t) nss;
|
|
|
|
syscallarg(netbsd32_sigstackp_t) oss;
|
1998-08-26 14:20:33 +04:00
|
|
|
} */ *uap = v;
|
|
|
|
struct compat_43_sys_sigstack_args ua;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_sigstack *ss32p;
|
1998-08-26 14:20:33 +04:00
|
|
|
struct sigstack nss, oss;
|
|
|
|
int rv;
|
|
|
|
|
|
|
|
if (SCARG(uap, oss))
|
|
|
|
SCARG(&ua, oss) = &oss;
|
|
|
|
else
|
|
|
|
SCARG(&ua, oss) = NULL;
|
|
|
|
if (SCARG(uap, nss)) {
|
|
|
|
SCARG(&ua, nss) = &nss;
|
1999-03-25 19:22:49 +03:00
|
|
|
ss32p = (struct netbsd32_sigstack *)(u_long)SCARG(uap, nss);
|
1998-08-26 14:20:33 +04:00
|
|
|
nss.ss_sp = (void *)(u_long)ss32p->ss_sp;
|
|
|
|
nss.ss_onstack = ss32p->ss_onstack;
|
|
|
|
} else
|
|
|
|
SCARG(&ua, nss) = NULL;
|
|
|
|
|
|
|
|
rv = compat_43_sys_sigstack(p, &ua, retval);
|
|
|
|
if (rv)
|
|
|
|
return (rv);
|
|
|
|
|
|
|
|
if (SCARG(uap, oss)) {
|
1999-03-25 19:22:49 +03:00
|
|
|
ss32p = (struct netbsd32_sigstack *)(u_long)SCARG(uap, oss);
|
|
|
|
ss32p->ss_sp = (netbsd32_sigstackp_t)(u_long)oss.ss_sp;
|
1998-08-26 14:20:33 +04:00
|
|
|
ss32p->ss_onstack = oss.ss_onstack;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|