Merge the nathanw_sa branch.

This commit is contained in:
thorpej 2003-01-19 16:41:46 +00:00
parent 5819507df3
commit 39279e53b5
20 changed files with 585 additions and 598 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldolduname.c,v 1.57 2003/01/18 21:26:36 jdolecek Exp $ */
/* $NetBSD: linux_oldolduname.c,v 1.58 2003/01/19 16:41:46 thorpej Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -37,13 +37,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.57 2003/01/18 21:26:36 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.58 2003/01/19 16:41:46 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/linux/common/linux_types.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_exec.h,v 1.4 2002/08/26 21:06:04 christos Exp $ */
/* $NetBSD: svr4_32_exec.h,v 1.5 2003/01/19 16:47:13 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@ int svr4_32_copyargs __P((struct proc *, struct exec_package *, struct ps_string
extern const struct emul emul_svr4_32;
void svr4_32_setregs __P((struct proc *, struct exec_package *, u_long));
void svr4_32_setregs __P((struct lwp *, struct exec_package *, u_long));
int svr4_32_elf32_probe __P((struct proc *, struct exec_package *, void *,
char *, vaddr_t *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_fcntl.c,v 1.5 2002/03/24 15:32:52 jdolecek Exp $ */
/* $NetBSD: svr4_32_fcntl.c,v 1.6 2003/01/19 16:47:13 thorpej Exp $ */
/*-
* Copyright (c) 1994, 1997 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_fcntl.c,v 1.5 2002/03/24 15:32:52 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_fcntl.c,v 1.6 2003/01/19 16:47:13 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_fcntl.c,v 1.5 2002/03/24 15:32:52 jdolecek E
#include <sys/malloc.h>
#include <sys/vnode.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>
@ -69,8 +70,8 @@ static void bsd_to_svr4_32_flock __P((struct flock *, struct svr4_32_flock *));
static void svr4_32_to_bsd_flock __P((struct svr4_32_flock *, struct flock *));
static void bsd_to_svr4_32_flock64 __P((struct flock *, struct svr4_32_flock64 *));
static void svr4_32_to_bsd_flock64 __P((struct svr4_32_flock64 *, struct flock *));
static int fd_revoke __P((struct proc *, int, register_t *));
static int fd_truncate __P((struct proc *, int, struct flock *, register_t *));
static int fd_revoke __P((struct lwp *, int, register_t *));
static int fd_truncate __P((struct lwp *, int, struct flock *, register_t *));
static u_long
svr4_32_to_bsd_cmd(cmd)
@ -257,11 +258,12 @@ svr4_32_to_bsd_flock64(iflp, oflp)
static int
fd_revoke(p, fd, retval)
struct proc *p;
fd_revoke(l, fd, retval)
struct lwp *l;
int fd;
register_t *retval;
{
struct proc *p = l->l_proc;
struct filedesc *fdp = p->p_fd;
struct file *fp;
struct vnode *vp;
@ -297,12 +299,13 @@ out:
static int
fd_truncate(p, fd, flp, retval)
struct proc *p;
fd_truncate(l, fd, flp, retval)
struct lwp *l;
int fd;
struct flock *flp;
register_t *retval;
{
struct proc *p = l->l_proc;
struct filedesc *fdp = p->p_fd;
struct file *fp;
off_t start, length;
@ -351,17 +354,18 @@ fd_truncate(p, fd, flp, retval)
SCARG(&ft, fd) = fd;
SCARG(&ft, length) = start;
return sys_ftruncate(p, &ft, retval);
return sys_ftruncate(l, &ft, retval);
}
int
svr4_32_sys_open(p, v, retval)
struct proc *p;
svr4_32_sys_open(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_open_args *uap = v;
struct proc *p = l->l_proc;
int error;
struct sys_open_args cup;
@ -376,7 +380,7 @@ svr4_32_sys_open(p, v, retval)
CHECK_ALT_EXIST(p, &sg, SCARG(&cup, path));
SCARG(&cup, mode) = SCARG(uap, mode);
error = sys_open(p, &cup, retval);
error = sys_open(l, &cup, retval);
if (error)
return error;
@ -397,22 +401,23 @@ svr4_32_sys_open(p, v, retval)
int
svr4_32_sys_open64(p, v, retval)
struct proc *p;
svr4_32_sys_open64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
return svr4_32_sys_open(p, v, retval);
return svr4_32_sys_open(l, v, retval);
}
int
svr4_32_sys_creat(p, v, retval)
struct proc *p;
svr4_32_sys_creat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_creat_args *uap = v;
struct proc *p = l->l_proc;
struct sys_open_args cup;
caddr_t sg = stackgap_init(p, 0);
@ -422,23 +427,23 @@ svr4_32_sys_creat(p, v, retval)
SCARG(&cup, mode) = SCARG(uap, mode);
SCARG(&cup, flags) = O_WRONLY | O_CREAT | O_TRUNC;
return sys_open(p, &cup, retval);
return sys_open(l, &cup, retval);
}
int
svr4_32_sys_creat64(p, v, retval)
struct proc *p;
svr4_32_sys_creat64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
return svr4_32_sys_creat(p, v, retval);
return svr4_32_sys_creat(l, v, retval);
}
int
svr4_32_sys_llseek(p, v, retval)
struct proc *p;
svr4_32_sys_llseek(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -456,17 +461,18 @@ svr4_32_sys_llseek(p, v, retval)
#endif
SCARG(&ap, whence) = SCARG(uap, whence);
return sys_lseek(p, &ap, retval);
return sys_lseek(l, &ap, retval);
}
int
svr4_32_sys_access(p, v, retval)
struct proc *p;
svr4_32_sys_access(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_access_args *uap = v;
struct sys_access_args cup;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
@ -474,13 +480,13 @@ svr4_32_sys_access(p, v, retval)
CHECK_ALT_EXIST(p, &sg, SCARG(&cup, path));
SCARG(&cup, flags) = SCARG(uap, flags);
return sys_access(p, &cup, retval);
return sys_access(l, &cup, retval);
}
int
svr4_32_sys_pread(p, v, retval)
struct proc *p;
svr4_32_sys_pread(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -496,13 +502,13 @@ svr4_32_sys_pread(p, v, retval)
SCARG(&pra, nbyte) = SCARG(uap, nbyte);
SCARG(&pra, offset) = SCARG(uap, off);
return (sys_pread(p, &pra, retval));
return (sys_pread(l, &pra, retval));
}
int
svr4_32_sys_pread64(p, v, retval)
struct proc *p;
svr4_32_sys_pread64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -519,13 +525,13 @@ svr4_32_sys_pread64(p, v, retval)
SCARG(&pra, nbyte) = SCARG(uap, nbyte);
SCARG(&pra, offset) = SCARG(uap, off);
return (sys_pread(p, &pra, retval));
return (sys_pread(l, &pra, retval));
}
int
svr4_32_sys_pwrite(p, v, retval)
struct proc *p;
svr4_32_sys_pwrite(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -541,13 +547,13 @@ svr4_32_sys_pwrite(p, v, retval)
SCARG(&pwa, nbyte) = SCARG(uap, nbyte);
SCARG(&pwa, offset) = SCARG(uap, off);
return (sys_pwrite(p, &pwa, retval));
return (sys_pwrite(l, &pwa, retval));
}
int
svr4_32_sys_pwrite64(p, v, retval)
struct proc *p;
svr4_32_sys_pwrite64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -563,17 +569,18 @@ svr4_32_sys_pwrite64(p, v, retval)
SCARG(&pwa, nbyte) = SCARG(uap, nbyte);
SCARG(&pwa, offset) = SCARG(uap, off);
return (sys_pwrite(p, &pwa, retval));
return (sys_pwrite(l, &pwa, retval));
}
int
svr4_32_sys_fcntl(p, v, retval)
struct proc *p;
svr4_32_sys_fcntl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_fcntl_args *uap = v;
struct proc *p = l->l_proc;
int error;
struct sys_fcntl_args fa;
@ -585,11 +592,11 @@ svr4_32_sys_fcntl(p, v, retval)
case F_GETFD:
case F_SETFD:
SCARG(&fa, arg) = (char *)(u_long)SCARG(uap, arg);
return sys_fcntl(p, &fa, retval);
return sys_fcntl(l, &fa, retval);
case F_GETFL:
SCARG(&fa, arg) = (char *)(u_long)SCARG(uap, arg);
error = sys_fcntl(p, &fa, retval);
error = sys_fcntl(l, &fa, retval);
if (error)
return error;
*retval = bsd_to_svr4_32_flags(*retval);
@ -607,13 +614,13 @@ svr4_32_sys_fcntl(p, v, retval)
cmd = SCARG(&fa, cmd); /* save it for a while */
SCARG(&fa, cmd) = F_GETFL;
if ((error = sys_fcntl(p, &fa, &flags)) != 0)
if ((error = sys_fcntl(l, &fa, &flags)) != 0)
return error;
flags &= O_ASYNC;
flags |= svr4_32_to_bsd_flags((u_long) SCARG(uap, arg));
SCARG(&fa, cmd) = cmd;
SCARG(&fa, arg) = (void *) flags;
return sys_fcntl(p, &fa, retval);
return sys_fcntl(l, &fa, retval);
}
case F_GETLK:
@ -638,7 +645,7 @@ svr4_32_sys_fcntl(p, v, retval)
if (error)
return error;
error = sys_fcntl(p, &fa, retval);
error = sys_fcntl(l, &fa, retval);
if (error || SCARG(&fa, cmd) != F_GETLK)
return error;
@ -659,7 +666,7 @@ svr4_32_sys_fcntl(p, v, retval)
SCARG(&du, from) = SCARG(uap, fd);
SCARG(&du, to) = (int)(u_long)SCARG(uap, arg);
error = sys_dup2(p, &du, retval);
error = sys_dup2(l, &du, retval);
if (error)
return error;
*retval = SCARG(&du, to);
@ -676,7 +683,7 @@ svr4_32_sys_fcntl(p, v, retval)
if (error)
return error;
svr4_32_to_bsd_flock(&ifl, &fl);
return fd_truncate(p, SCARG(uap, fd), &fl,
return fd_truncate(l, SCARG(uap, fd), &fl,
retval);
}
@ -702,7 +709,7 @@ svr4_32_sys_fcntl(p, v, retval)
if (error)
return error;
error = sys_fcntl(p, &fa, retval);
error = sys_fcntl(l, &fa, retval);
if (error || SCARG(&fa, cmd) != F_GETLK)
return error;
@ -726,12 +733,12 @@ svr4_32_sys_fcntl(p, v, retval)
if (error)
return error;
svr4_32_to_bsd_flock64(&ifl, &fl);
return fd_truncate(p, SCARG(uap, fd), &fl,
return fd_truncate(l, SCARG(uap, fd), &fl,
retval);
}
case SVR4_F_REVOKE:
return fd_revoke(p, SCARG(uap, fd), retval);
return fd_revoke(l, SCARG(uap, fd), retval);
default:
return ENOSYS;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_filio.c,v 1.2 2001/11/13 02:09:28 lukem Exp $ */
/* $NetBSD: svr4_32_filio.c,v 1.3 2003/01/19 16:47:14 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_filio.c,v 1.2 2001/11/13 02:09:28 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_filio.c,v 1.3 2003/01/19 16:47:14 thorpej Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_filio.c,v 1.2 2001/11/13 02:09:28 lukem Exp
#include <net/if.h>
#include <sys/malloc.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_ioctl.c,v 1.7 2002/07/22 05:31:18 matt Exp $ */
/* $NetBSD: svr4_32_ioctl.c,v 1.8 2003/01/19 16:47:14 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.7 2002/07/22 05:31:18 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.8 2003/01/19 16:47:14 thorpej Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.7 2002/07/22 05:31:18 matt Exp $
#include <net/if.h>
#include <sys/malloc.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>
@ -97,16 +98,17 @@ svr4_32_decode_cmd(cmd, dir, c, num, argsiz)
#endif
int
svr4_32_sys_ioctl(p, v, retval)
struct proc *p;
svr4_32_sys_ioctl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_ioctl_args *uap = v;
struct proc *p = l->l_proc;
struct file *fp;
struct filedesc *fdp;
u_long cmd;
int (*fun) __P((struct file *, struct proc *, register_t *,
int (*fun) __P((struct file *, struct lwp *, register_t *,
int, u_long, caddr_t));
#ifdef DEBUG_SVR4
char dir[4];
@ -157,6 +159,6 @@ svr4_32_sys_ioctl(p, v, retval)
DPRINTF(("Unimplemented ioctl %lx\n", cmd));
return 0; /* XXX: really ENOSYS */
}
return (*fun)(fp, p, retval, SCARG(uap, fd), cmd,
return (*fun)(fp, l, retval, SCARG(uap, fd), cmd,
(caddr_t)(u_long)SCARG(uap, data));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_ioctl.h,v 1.1 2001/02/06 16:37:57 eeh Exp $ */
/* $NetBSD: svr4_32_ioctl.h,v 1.2 2003/01/19 16:47:14 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -41,17 +41,17 @@
#include <compat/svr4/svr4_ioctl.h>
int svr4_32_stream_ti_ioctl __P((struct file *, struct proc *, register_t *,
int svr4_32_stream_ti_ioctl __P((struct file *, struct lwp *, register_t *,
int, u_long, caddr_t));
int svr4_32_stream_ioctl __P((struct file *, struct proc *, register_t *,
int svr4_32_stream_ioctl __P((struct file *, struct lwp *, register_t *,
int, u_long, caddr_t));
int svr4_32_term_ioctl __P((struct file *, struct proc *, register_t *,
int svr4_32_term_ioctl __P((struct file *, struct lwp *, register_t *,
int, u_long, caddr_t));
int svr4_32_ttold_ioctl __P((struct file *, struct proc *, register_t *,
int svr4_32_ttold_ioctl __P((struct file *, struct lwp *, register_t *,
int, u_long, caddr_t));
int svr4_32_fil_ioctl __P((struct file *, struct proc *, register_t *,
int svr4_32_fil_ioctl __P((struct file *, struct lwp *, register_t *,
int, u_long, caddr_t));
int svr4_32_sock_ioctl __P((struct file *, struct proc *, register_t *,
int svr4_32_sock_ioctl __P((struct file *, struct lwp *, register_t *,
int, u_long, caddr_t));
#endif /* !_SVR4_32_IOCTL_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_ipc.c,v 1.5 2002/03/16 20:43:57 christos Exp $ */
/* $NetBSD: svr4_32_ipc.c,v 1.6 2003/01/19 16:47:14 thorpej Exp $ */
/*-
* Copyright (c) 1995 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_ipc.c,v 1.5 2002/03/16 20:43:57 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_ipc.c,v 1.6 2003/01/19 16:47:14 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_sysv.h"
@ -57,6 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_ipc.c,v 1.5 2002/03/16 20:43:57 christos Exp
#include <sys/stat.h>
#include <sys/mount.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>
@ -79,9 +80,9 @@ static void bsd_to_svr4_32_semid_ds __P((const struct semid_ds *,
struct svr4_32_semid_ds *));
static void svr4_32_to_bsd_semid_ds __P((const struct svr4_32_semid_ds *,
struct semid_ds *));
static int svr4_32_semop __P((struct proc *, void *, register_t *));
static int svr4_32_semget __P((struct proc *, void *, register_t *));
static int svr4_32_semctl __P((struct proc *, void *, register_t *));
static int svr4_32_semop __P((struct lwp *, void *, register_t *));
static int svr4_32_semget __P((struct lwp *, void *, register_t *));
static int svr4_32_semctl __P((struct lwp *, void *, register_t *));
#endif
#ifdef SYSVMSG
@ -89,10 +90,10 @@ static void bsd_to_svr4_32_msqid_ds __P((const struct msqid_ds *,
struct svr4_32_msqid_ds *));
static void svr4_32_to_bsd_msqid_ds __P((const struct svr4_32_msqid_ds *,
struct msqid_ds *));
static int svr4_32_msgsnd __P((struct proc *, void *, register_t *));
static int svr4_32_msgrcv __P((struct proc *, void *, register_t *));
static int svr4_32_msgget __P((struct proc *, void *, register_t *));
static int svr4_32_msgctl __P((struct proc *, void *, register_t *));
static int svr4_32_msgsnd __P((struct lwp *, void *, register_t *));
static int svr4_32_msgrcv __P((struct lwp *, void *, register_t *));
static int svr4_32_msgget __P((struct lwp *, void *, register_t *));
static int svr4_32_msgctl __P((struct lwp *, void *, register_t *));
#endif
#ifdef SYSVSHM
@ -100,10 +101,10 @@ static void bsd_to_svr4_32_shmid_ds __P((const struct shmid_ds *,
struct svr4_32_shmid_ds *));
static void svr4_32_to_bsd_shmid_ds __P((const struct svr4_32_shmid_ds *,
struct shmid_ds *));
static int svr4_32_shmat __P((struct proc *, void *, register_t *));
static int svr4_32_shmdt __P((struct proc *, void *, register_t *));
static int svr4_32_shmget __P((struct proc *, void *, register_t *));
static int svr4_32_shmctl __P((struct proc *, void *, register_t *));
static int svr4_32_shmat __P((struct lwp *, void *, register_t *));
static int svr4_32_shmdt __P((struct lwp *, void *, register_t *));
static int svr4_32_shmget __P((struct lwp *, void *, register_t *));
static int svr4_32_shmctl __P((struct lwp *, void *, register_t *));
#endif
#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM)
@ -171,12 +172,13 @@ struct svr4_32_sys_semctl_args {
};
static int
svr4_32_semctl(p, v, retval)
struct proc *p;
svr4_32_semctl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_semctl_args *uap = v;
struct proc *p = l->l_proc;
struct semid_ds sembuf;
struct svr4_32_semid_ds ssembuf;
int cmd, error;
@ -262,8 +264,8 @@ struct svr4_32_sys_semget_args {
};
static int
svr4_32_semget(p, v, retval)
struct proc *p;
svr4_32_semget(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -274,7 +276,7 @@ svr4_32_semget(p, v, retval)
SCARG(&ap, nsems) = SCARG(uap, nsems);
SCARG(&ap, semflg) = SCARG(uap, semflg);
return sys_semget(p, &ap, retval);
return sys_semget(l, &ap, retval);
}
struct svr4_32_sys_semop_args {
@ -285,8 +287,8 @@ struct svr4_32_sys_semop_args {
};
static int
svr4_32_semop(p, v, retval)
struct proc *p;
svr4_32_semop(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -298,12 +300,12 @@ svr4_32_semop(p, v, retval)
SCARG(&ap, sops) = (struct sembuf *)(u_long)SCARG(uap, sops);
SCARG(&ap, nsops) = SCARG(uap, nsops);
return sys_semop(p, &ap, retval);
return sys_semop(l, &ap, retval);
}
int
svr4_32_sys_semsys(p, v, retval)
struct proc *p;
svr4_32_sys_semsys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -313,11 +315,11 @@ svr4_32_sys_semsys(p, v, retval)
switch (SCARG(uap, what)) {
case SVR4_semctl:
return svr4_32_semctl(p, v, retval);
return svr4_32_semctl(l, v, retval);
case SVR4_semget:
return svr4_32_semget(p, v, retval);
return svr4_32_semget(l, v, retval);
case SVR4_semop:
return svr4_32_semop(p, v, retval);
return svr4_32_semop(l, v, retval);
default:
return EINVAL;
}
@ -381,8 +383,8 @@ struct svr4_32_sys_msgsnd_args {
};
static int
svr4_32_msgsnd(p, v, retval)
struct proc *p;
svr4_32_msgsnd(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -394,7 +396,7 @@ svr4_32_msgsnd(p, v, retval)
SCARG(&ap, msgsz) = SCARG(uap, msgsz);
SCARG(&ap, msgflg) = SCARG(uap, msgflg);
return sys_msgsnd(p, &ap, retval);
return sys_msgsnd(l, &ap, retval);
}
struct svr4_32_sys_msgrcv_args {
@ -407,8 +409,8 @@ struct svr4_32_sys_msgrcv_args {
};
static int
svr4_32_msgrcv(p, v, retval)
struct proc *p;
svr4_32_msgrcv(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -421,7 +423,7 @@ svr4_32_msgrcv(p, v, retval)
SCARG(&ap, msgtyp) = SCARG(uap, msgtyp);
SCARG(&ap, msgflg) = SCARG(uap, msgflg);
return sys_msgrcv(p, &ap, retval);
return sys_msgrcv(l, &ap, retval);
}
struct svr4_32_sys_msgget_args {
@ -431,8 +433,8 @@ struct svr4_32_sys_msgget_args {
};
static int
svr4_32_msgget(p, v, retval)
struct proc *p;
svr4_32_msgget(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -442,7 +444,7 @@ svr4_32_msgget(p, v, retval)
SCARG(&ap, key) = SCARG(uap, key);
SCARG(&ap, msgflg) = SCARG(uap, msgflg);
return sys_msgget(p, &ap, retval);
return sys_msgget(l, &ap, retval);
}
struct svr4_32_sys_msgctl_args {
@ -453,13 +455,14 @@ struct svr4_32_sys_msgctl_args {
};
static int
svr4_32_msgctl(p, v, retval)
struct proc *p;
svr4_32_msgctl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
int error;
struct svr4_32_sys_msgctl_args *uap = v;
struct proc *p = l->l_proc;
struct sys___msgctl13_args ap;
struct svr4_32_msqid_ds ss;
struct msqid_ds bs;
@ -472,7 +475,7 @@ svr4_32_msgctl(p, v, retval)
switch (SCARG(uap, cmd)) {
case SVR4_IPC_STAT:
SCARG(&ap, cmd) = IPC_STAT;
if ((error = sys___msgctl13(p, &ap, retval)) != 0)
if ((error = sys___msgctl13(l, &ap, retval)) != 0)
return error;
error = copyin(&bs, SCARG(&ap, buf), sizeof bs);
if (error)
@ -489,7 +492,7 @@ svr4_32_msgctl(p, v, retval)
error = copyout(&bs, SCARG(&ap, buf), sizeof bs);
if (error)
return error;
return sys___msgctl13(p, &ap, retval);
return sys___msgctl13(l, &ap, retval);
case SVR4_IPC_RMID:
SCARG(&ap, cmd) = IPC_RMID;
@ -500,7 +503,7 @@ svr4_32_msgctl(p, v, retval)
error = copyout(&bs, SCARG(&ap, buf), sizeof bs);
if (error)
return error;
return sys___msgctl13(p, &ap, retval);
return sys___msgctl13(l, &ap, retval);
default:
return EINVAL;
@ -508,8 +511,8 @@ svr4_32_msgctl(p, v, retval)
}
int
svr4_32_sys_msgsys(p, v, retval)
struct proc *p;
svr4_32_sys_msgsys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -519,13 +522,13 @@ svr4_32_sys_msgsys(p, v, retval)
switch (SCARG(uap, what)) {
case SVR4_msgsnd:
return svr4_32_msgsnd(p, v, retval);
return svr4_32_msgsnd(l, v, retval);
case SVR4_msgrcv:
return svr4_32_msgrcv(p, v, retval);
return svr4_32_msgrcv(l, v, retval);
case SVR4_msgget:
return svr4_32_msgget(p, v, retval);
return svr4_32_msgget(l, v, retval);
case SVR4_msgctl:
return svr4_32_msgctl(p, v, retval);
return svr4_32_msgctl(l, v, retval);
default:
return EINVAL;
}
@ -579,8 +582,8 @@ struct svr4_32_sys_shmat_args {
};
static int
svr4_32_shmat(p, v, retval)
struct proc *p;
svr4_32_shmat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -591,7 +594,7 @@ svr4_32_shmat(p, v, retval)
SCARG(&ap, shmaddr) = (void *)(u_long)SCARG(uap, shmaddr);
SCARG(&ap, shmflg) = SCARG(uap, shmflg);
return sys_shmat(p, &ap, retval);
return sys_shmat(l, &ap, retval);
}
struct svr4_32_sys_shmdt_args {
@ -600,8 +603,8 @@ struct svr4_32_sys_shmdt_args {
};
static int
svr4_32_shmdt(p, v, retval)
struct proc *p;
svr4_32_shmdt(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -610,7 +613,7 @@ svr4_32_shmdt(p, v, retval)
SCARG(&ap, shmaddr) = (void *)(u_long)SCARG(uap, shmaddr);
return sys_shmdt(p, &ap, retval);
return sys_shmdt(l, &ap, retval);
}
struct svr4_32_sys_shmget_args {
@ -621,8 +624,8 @@ struct svr4_32_sys_shmget_args {
};
static int
svr4_32_shmget(p, v, retval)
struct proc *p;
svr4_32_shmget(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -633,7 +636,7 @@ svr4_32_shmget(p, v, retval)
SCARG(&ap, size) = SCARG(uap, size);
SCARG(&ap, shmflg) = SCARG(uap, shmflg);
return sys_shmget(p, &ap, retval);
return sys_shmget(l, &ap, retval);
}
struct svr4_32_sys_shmctl_args {
@ -644,13 +647,14 @@ struct svr4_32_sys_shmctl_args {
};
int
svr4_32_shmctl(p, v, retval)
struct proc *p;
svr4_32_shmctl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_shmctl_args *uap = v;
int error;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
struct sys___shmctl13_args ap;
struct shmid_ds bs;
@ -685,7 +689,7 @@ svr4_32_shmctl(p, v, retval)
switch (SCARG(uap, cmd)) {
case SVR4_IPC_STAT:
SCARG(&ap, cmd) = IPC_STAT;
if ((error = sys___shmctl13(p, &ap, retval)) != 0)
if ((error = sys___shmctl13(l, &ap, retval)) != 0)
return error;
if (SCARG(uap, buf) == NULL)
return 0;
@ -697,7 +701,7 @@ svr4_32_shmctl(p, v, retval)
case SVR4_IPC_SET:
SCARG(&ap, cmd) = IPC_SET;
return sys___shmctl13(p, &ap, retval);
return sys___shmctl13(l, &ap, retval);
case SVR4_IPC_RMID:
case SVR4_SHM_LOCK:
@ -715,7 +719,7 @@ svr4_32_shmctl(p, v, retval)
default:
return EINVAL;
}
return sys___shmctl13(p, &ap, retval);
return sys___shmctl13(l, &ap, retval);
default:
return EINVAL;
@ -723,8 +727,8 @@ svr4_32_shmctl(p, v, retval)
}
int
svr4_32_sys_shmsys(p, v, retval)
struct proc *p;
svr4_32_sys_shmsys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -734,13 +738,13 @@ svr4_32_sys_shmsys(p, v, retval)
switch (SCARG(uap, what)) {
case SVR4_shmat:
return svr4_32_shmat(p, v, retval);
return svr4_32_shmat(l, v, retval);
case SVR4_shmdt:
return svr4_32_shmdt(p, v, retval);
return svr4_32_shmdt(l, v, retval);
case SVR4_shmget:
return svr4_32_shmget(p, v, retval);
return svr4_32_shmget(l, v, retval);
case SVR4_shmctl:
return svr4_32_shmctl(p, v, retval);
return svr4_32_shmctl(l, v, retval);
default:
return ENOSYS;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_lwp.c,v 1.3 2001/11/13 02:09:29 lukem Exp $ */
/* $NetBSD: svr4_32_lwp.c,v 1.4 2003/01/19 16:47:14 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_lwp.c,v 1.3 2001/11/13 02:09:29 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_lwp.c,v 1.4 2003/01/19 16:47:14 thorpej Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_lwp.c,v 1.3 2001/11/13 02:09:29 lukem Exp $"
#include <sys/user.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <sys/un.h>
#include <sys/stat.h>
@ -77,69 +78,42 @@ svr4_32_sys__lwp_self(p, v, retval)
}
#endif
int
svr4_32_sys__lwp_create(p, v, retval)
struct proc *p;
svr4_32_sys__lwp_create(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys__lwp_create_args *uap = v;
int error;
struct proc *pt;
svr4_32_ucontext_t uc;
#define SVR4_FORK_FLAGS \
(FORK_SHAREVM|FORK_SHARECWD|FORK_SHAREFILES|FORK_SHARESIGS)
if ((error = fork1(p, SVR4_FORK_FLAGS, SIGCHLD, NULL, 0,
NULL, NULL, retval, &pt)) == -1)
return error;
struct sys__lwp_create_args lc;
int flags;
flags = 0;
if (SCARG(uap, flags) & SVR4_LWP_DETACHED)
pt->p_flag &= ~P_CONTROLT;
flags &= LWP_DETACHED;
if (SCARG(uap, flags) & SVR4_LWP_SUSPENDED)
pt->p_stat = SSTOP;
flags &= LWP_SUSPENDED;
if (SCARG(uap, flags) & SVR4___LWP_ASLWP) {
/*
* XXX: This does not really work, we don't have
* the facility to deliver all async signals
* to a single lwp, and also we don't keep
* track of having only one ASLWP. For now
* we just block all signals as we are supposed
* to.
*/
sigset_t ss;
sigfillset(&ss);
(void)sigprocmask1(pt, SIG_BLOCK, &ss, 0);
} else {
/*
* XXX: We block all signals to the rest of the of
* the lwp's, so that they don't get confused
* as of the above. Will that work? What does
* sharing s
*/
sigset_t ss;
sigfillset(&ss);
(void)sigprocmask1(pt, SIG_BLOCK, &ss, 0);
/* XXX Punt! */
}
if ((error = copyin((caddr_t)(u_long)SCARG(uap, uc), &uc, sizeof(uc))) != 0)
return error;
if ((error = svr4_32_setcontext(pt, &uc)) != 0)
return error;
if ((error = copyout(&pt->p_pid, (caddr_t)(u_long)SCARG(uap, lwpid),
sizeof(svr4_lwpid_t))) == -1)
return error;
return 0;
#if 0
/* XXX this is probably incorrect */
SCARG(&lc, ucp) = (ucontext_t *)SCARG(uap, uc);
SCARG(&lc, new_lwp) = SCARG(uap, lwpid);
#endif
SCARG(&lc, flags) = flags;
return sys__lwp_create(l, &lc, retval);
}
int
svr4_32_sys__lwp_kill(p, v, retval)
struct proc *p;
svr4_32_sys__lwp_kill(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -148,16 +122,17 @@ svr4_32_sys__lwp_kill(p, v, retval)
SCARG(&ap, pid) = SCARG(uap, lwpid);
SCARG(&ap, signum) = SCARG(uap, signum);
return sys_kill(p, &ap, retval);
return sys_kill(l, &ap, retval);
}
int
svr4_32_sys__lwp_info(p, v, retval)
struct proc *p;
svr4_32_sys__lwp_info(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys__lwp_info_args *uap = v;
struct proc *p = l->l_proc;
struct svr4_32_lwpinfo lwpinfo;
int error;
@ -171,129 +146,84 @@ svr4_32_sys__lwp_info(p, v, retval)
}
int
svr4_32_sys__lwp_exit(p, v, retval)
struct proc *p;
svr4_32_sys__lwp_exit(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct sys_exit_args ap;
int error;
/* XXX: We don't handle the suspended case correctly here */
SCARG(&ap, rval) = 0;
if ((error = sys_exit(p, &ap, retval)) == -1)
return error;
*retval = 0;
return 0;
return sys__lwp_exit(l, NULL, retval);
}
int
svr4_32_sys__lwp_wait(p, v, retval)
struct proc *p;
svr4_32_sys__lwp_wait(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys__lwp_wait_args *uap = v;
struct sys_wait4_args ap;
int error;
struct sys__lwp_wait_args ap;
SCARG(&ap, pid) = SCARG(uap, wait_for);
SCARG(&ap, status) = NULL;
SCARG(&ap, options) = 0;
SCARG(&ap, wait_for) = SCARG(uap, wait_for);
SCARG(&ap, departed) = SCARG(uap, departed_lwp);
if ((error = sys_wait4(p, &ap, retval)) == -1)
return error;
if (SCARG(uap, departed_lwp) != NULL)
if ((error = copyout(retval, (caddr_t)(u_long)SCARG(uap, departed_lwp),
sizeof(svr4_lwpid_t))) == -1)
return error;
*retval = 0;
return 0;
return sys__lwp_wait(l, &ap, retval);
}
/* XXX Stolen from kern_sig.c */
#define CANSIGNAL(p, pc, q, signum) \
((pc)->pc_ucred->cr_uid == 0 || \
(pc)->p_ruid == (q)->p_cred->p_ruid || \
(pc)->pc_ucred->cr_uid == (q)->p_cred->p_ruid || \
(pc)->p_ruid == (q)->p_ucred->cr_uid || \
(pc)->pc_ucred->cr_uid == (q)->p_ucred->cr_uid || \
((signum) == SIGCONT && (q)->p_session == (p)->p_session))
int
svr4_32_sys__lwp_suspend(p, v, retval)
struct proc *p;
svr4_32_sys__lwp_suspend(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys__lwp_suspend_args *uap = v;
struct proc *pt;
struct sys__lwp_suspend_args ap;
/* Security implications here! */
if ((pt = pfind(SCARG(uap, lwpid))) == NULL)
return ESRCH;
SCARG(&ap, target) = SCARG(uap, lwpid);
if (!CANSIGNAL(p, p->p_cred, pt, 0))
return EPERM;
pt->p_stat = SSTOP;
return 0;
return sys__lwp_suspend(l, &ap, retval);
}
int
svr4_32_sys__lwp_continue(p, v, retval)
struct proc *p;
svr4_32_sys__lwp_continue(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys__lwp_continue_args *uap = v;
struct proc *pt;
struct sys__lwp_continue_args ap;
if ((pt = pfind(SCARG(uap, lwpid))) == NULL)
return ESRCH;
SCARG(&ap, target) = SCARG(uap, lwpid);
if (!CANSIGNAL(p, p->p_cred, pt, 0))
return EPERM;
return sys__lwp_continue(l, &ap, retval);
}
pt->p_stat = SRUN;
int
svr4_32_sys__lwp_getprivate(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
/* XXX NJWLWP: Replace with call to native version if we ever
* implement that. */
*retval = (register_t)l->l_private;
return 0;
}
int
svr4_32_sys__lwp_getprivate(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
/* XXX: Use mach field! */
*retval = (register_t)p->p_thread;
return 0;
}
int
svr4_32_sys__lwp_setprivate(p, v, retval)
struct proc *p;
svr4_32_sys__lwp_setprivate(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
#if 0
struct svr4_32_sys__lwp_setprivate_args *uap = v;
/*
* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*
* This has many problems:
*
* 1) we are using an old, left over field from Mach
*
* 2) the lwpid_t is an unsigned int but the p_thread
* field is a (64-bit) pointer.
*
* 3) we're copying in 64-bits from a 32-bit field.
*/
return copyin((caddr_t)(u_long)SCARG(uap, buffer),
&p->p_thread, sizeof(void *));
/* XXX NJWLWP: Replace with call to native version if we ever
* implement that. */
return copyin(SCARG(uap, buffer), &l->l_private, sizeof(void *));
#endif
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_misc.c,v 1.13 2002/07/28 18:42:42 jdolecek Exp $ */
/* $NetBSD: svr4_32_misc.c,v 1.14 2003/01/19 16:47:14 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.13 2002/07/28 18:42:42 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.14 2003/01/19 16:47:14 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -77,6 +77,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.13 2002/07/28 18:42:42 jdolecek E
#include <sys/signalvar.h>
#include <netinet/in.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <miscfs/specfs/specdev.h>
@ -115,16 +116,17 @@ static void bsd_statfs_to_svr4_32_statvfs64 __P((const struct statfs *,
struct svr4_32_statvfs64 *));
static struct proc *svr4_32_pfind __P((pid_t pid));
static int svr4_32_mknod __P((struct proc *, register_t *, const char *,
static int svr4_32_mknod __P((struct lwp *, register_t *, const char *,
svr4_32_mode_t, svr4_32_dev_t));
int
svr4_32_sys_wait(p, v, retval)
struct proc *p;
svr4_32_sys_wait(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_wait_args *uap = v;
struct proc *p = l->l_proc;
struct sys_wait4_args w4;
int error;
size_t sz = sizeof(*SCARG(&w4, status));
@ -143,7 +145,7 @@ svr4_32_sys_wait(p, v, retval)
SCARG(&w4, pid) = WAIT_ANY;
if ((error = sys_wait4(p, &w4, retval)) != 0)
if ((error = sys_wait4(l, &w4, retval)) != 0)
return error;
if ((error = copyin(SCARG(&w4, status), &st, sizeof(st))) != 0)
@ -175,8 +177,8 @@ svr4_32_sys_wait(p, v, retval)
int
svr4_32_sys_execv(p, v, retval)
struct proc *p;
svr4_32_sys_execv(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -194,7 +196,7 @@ svr4_32_sys_execv(p, v, retval)
SCARG(&ap, argp) = SCARG(uap, argp);
SCARG(&ap, envp) = NULL;
return netbsd32_execve(p, &ap, retval);
return netbsd32_execve(l, &ap, retval);
}
#if 0
@ -224,8 +226,8 @@ svr4_32_sys_execve(p, v, retval)
#endif
int
svr4_32_sys_time(p, v, retval)
struct proc *p;
svr4_32_sys_time(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -254,12 +256,13 @@ svr4_32_sys_time(p, v, retval)
* This is quite ugly, but what do you expect from compatibility code?
*/
int
svr4_32_sys_getdents64(p, v, retval)
struct proc *p;
svr4_32_sys_getdents64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_getdents64_args *uap = v;
struct proc *p = l->l_proc;
struct dirent *bdp;
struct vnode *vp;
caddr_t inp, buf; /* BSD-format */
@ -373,12 +376,13 @@ out:
int
svr4_32_sys_getdents(p, v, retval)
struct proc *p;
svr4_32_sys_getdents(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_getdents_args *uap = v;
struct proc *p = l->l_proc;
struct dirent *bdp;
struct vnode *vp;
caddr_t inp, buf; /* BSD-format */
@ -514,12 +518,13 @@ svr4_to_bsd_mmap_flags(f)
int
svr4_32_sys_mmap(p, v, retval)
struct proc *p;
svr4_32_sys_mmap(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_mmap_args *uap = v;
struct proc *p = l->l_proc;
struct sys_mmap_args mm;
void *rp;
int error;
@ -546,7 +551,7 @@ svr4_32_sys_mmap(p, v, retval)
SCARG(&mm, addr) != 0 && SCARG(&mm, addr) < rp)
SCARG(&mm, addr) = rp;
error = sys_mmap(p, &mm, (register_t *)&rp);
error = sys_mmap(l, &mm, (register_t *)&rp);
if ((u_long)rp > (u_long)UINT_MAX) {
printf("svr4_32_mmap: retval out of range: %p", rp);
/* Should try to recover and return an error here. */
@ -557,13 +562,14 @@ svr4_32_sys_mmap(p, v, retval)
int
svr4_32_sys_mmap64(p, v, retval)
struct proc *p;
svr4_32_sys_mmap64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_mmap64_args *uap = v;
struct sys_mmap_args mm;
struct proc *p = l->l_proc;
void *rp;
int error;
/*
@ -589,7 +595,7 @@ svr4_32_sys_mmap64(p, v, retval)
SCARG(&mm, addr) != 0 && SCARG(&mm, addr) < rp)
SCARG(&mm, addr) = rp;
error = sys_mmap(p, &mm, (register_t *)&rp);
error = sys_mmap(l, &mm, (register_t *)&rp);
if ((u_long)rp > (u_long)UINT_MAX) {
printf("svr4_32_mmap64: retval out of range: %p", rp);
/* Should try to recover and return an error here. */
@ -600,61 +606,61 @@ svr4_32_sys_mmap64(p, v, retval)
static int
svr4_32_mknod(p, retval, path, mode, dev)
struct proc *p;
svr4_32_mknod(l, retval, path, mode, dev)
struct lwp *l;
register_t *retval;
const char *path;
svr4_32_mode_t mode;
svr4_32_dev_t dev;
{
caddr_t sg = stackgap_init(p, 0);
caddr_t sg = stackgap_init(l->l_proc, 0);
CHECK_ALT_CREAT(p, &sg, path);
CHECK_ALT_CREAT(l->l_proc, &sg, path);
if (S_ISFIFO(mode)) {
struct sys_mkfifo_args ap;
SCARG(&ap, path) = path;
SCARG(&ap, mode) = mode;
return sys_mkfifo(p, &ap, retval);
return sys_mkfifo(l, &ap, retval);
} else {
struct sys_mknod_args ap;
SCARG(&ap, path) = path;
SCARG(&ap, mode) = mode;
SCARG(&ap, dev) = dev;
return sys_mknod(p, &ap, retval);
return sys_mknod(l, &ap, retval);
}
}
int
svr4_32_sys_mknod(p, v, retval)
struct proc *p;
svr4_32_sys_mknod(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_mknod_args *uap = v;
return svr4_32_mknod(p, retval,
return svr4_32_mknod(l, retval,
(caddr_t)(u_long)SCARG(uap, path), SCARG(uap, mode),
svr4_32_to_bsd_odev_t(SCARG(uap, dev)));
}
int
svr4_32_sys_xmknod(p, v, retval)
struct proc *p;
svr4_32_sys_xmknod(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_xmknod_args *uap = v;
return svr4_32_mknod(p, retval,
return svr4_32_mknod(l, retval,
(caddr_t)(u_long)SCARG(uap, path), SCARG(uap, mode),
svr4_32_to_bsd_dev_t(SCARG(uap, dev)));
}
int
svr4_32_sys_vhangup(p, v, retval)
struct proc *p;
svr4_32_sys_vhangup(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -663,8 +669,8 @@ svr4_32_sys_vhangup(p, v, retval)
int
svr4_32_sys_sysconfig(p, v, retval)
struct proc *p;
svr4_32_sys_sysconfig(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -801,12 +807,13 @@ svr4_32_sys_sysconfig(p, v, retval)
/* ARGSUSED */
int
svr4_32_sys_break(p, v, retval)
struct proc *p;
svr4_32_sys_break(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_break_args *uap = v;
struct proc *p = l->l_proc;
struct vmspace *vm = p->p_vmspace;
vaddr_t new, old;
int error;
@ -850,12 +857,13 @@ timeval_to_clock_t(tv)
int
svr4_32_sys_times(p, v, retval)
struct proc *p;
svr4_32_sys_times(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_times_args *uap = v;
struct proc *p = l->l_proc;
int error;
struct tms tms;
struct timeval t;
@ -869,7 +877,7 @@ svr4_32_sys_times(p, v, retval)
SCARG(&ga, who) = RUSAGE_SELF;
SCARG(&ga, rusage) = ru;
error = sys_getrusage(p, &ga, retval);
error = sys_getrusage(l, &ga, retval);
if (error)
return error;
@ -880,7 +888,7 @@ svr4_32_sys_times(p, v, retval)
tms.tms_stime = timeval_to_clock_t(&r.ru_stime);
SCARG(&ga, who) = RUSAGE_CHILDREN;
error = sys_getrusage(p, &ga, retval);
error = sys_getrusage(l, &ga, retval);
if (error)
return error;
@ -898,12 +906,13 @@ svr4_32_sys_times(p, v, retval)
int
svr4_32_sys_ulimit(p, v, retval)
struct proc *p;
svr4_32_sys_ulimit(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_ulimit_args *uap = v;
struct proc *p = l->l_proc;
switch (SCARG(uap, cmd)) {
case SVR4_GFILLIM:
@ -931,7 +940,7 @@ svr4_32_sys_ulimit(p, v, retval)
SCARG(&srl, which) = RLIMIT_FSIZE;
SCARG(&srl, rlp) = url;
error = sys_setrlimit(p, &srl, retval);
error = sys_setrlimit(l, &srl, retval);
if (error)
return error;
@ -991,12 +1000,13 @@ svr4_32_pfind(pid)
int
svr4_32_sys_pgrpsys(p, v, retval)
struct proc *p;
svr4_32_sys_pgrpsys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_pgrpsys_args *uap = v;
struct proc *p = l->l_proc;
switch (SCARG(uap, cmd)) {
case 1: /* setpgrp() */
@ -1007,7 +1017,7 @@ svr4_32_sys_pgrpsys(p, v, retval)
* setsid() for SVR4. (Under BSD, the difference is that
* a setpgid(0,0) will not create a new session.)
*/
sys_setsid(p, NULL, retval);
sys_setsid(l, NULL, retval);
/*FALLTHROUGH*/
case 0: /* getpgrp() */
@ -1026,7 +1036,7 @@ svr4_32_sys_pgrpsys(p, v, retval)
return 0;
case 3: /* setsid() */
return sys_setsid(p, NULL, retval);
return sys_setsid(l, NULL, retval);
case 4: /* getpgid(pid) */
@ -1043,7 +1053,7 @@ svr4_32_sys_pgrpsys(p, v, retval)
SCARG(&sa, pid) = SCARG(uap, pid);
SCARG(&sa, pgid) = SCARG(uap, pgid);
return sys_setpgid(p, &sa, retval);
return sys_setpgid(l, &sa, retval);
}
default:
@ -1108,8 +1118,8 @@ svr4_32_hrtcntl(p, uap, retval)
int
svr4_32_sys_hrtsys(p, v, retval)
struct proc *p;
svr4_32_sys_hrtsys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1117,7 +1127,7 @@ svr4_32_sys_hrtsys(p, v, retval)
switch (SCARG(uap, cmd)) {
case SVR4_HRT_CNTL:
return svr4_32_hrtcntl(p, (struct svr4_32_hrtcntl_args *) uap,
return svr4_32_hrtcntl(l->l_proc, (struct svr4_32_hrtcntl_args *) uap,
retval);
case SVR4_HRT_ALRM:
@ -1197,12 +1207,13 @@ svr4_32_setinfo(p, st, si)
int
svr4_32_sys_waitsys(p, v, retval)
struct proc *p;
svr4_32_sys_waitsys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_waitsys_args *uap = v;
struct proc *p = l->l_proc;
int nfound, error, s;
struct proc *q, *t;
@ -1389,12 +1400,13 @@ bsd_statfs_to_svr4_32_statvfs64(bfs, sfs)
int
svr4_32_sys_statvfs(p, v, retval)
struct proc *p;
svr4_32_sys_statvfs(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_statvfs_args *uap = v;
struct proc *p = l->l_proc;
struct sys_statfs_args fs_args;
caddr_t sg = stackgap_init(p, 0);
struct statfs *fs = stackgap_alloc(p, &sg, sizeof(struct statfs));
@ -1406,7 +1418,7 @@ svr4_32_sys_statvfs(p, v, retval)
CHECK_ALT_EXIST(p, &sg, SCARG(&fs_args, path));
SCARG(&fs_args, buf) = fs;
if ((error = sys_statfs(p, &fs_args, retval)) != 0)
if ((error = sys_statfs(l, &fs_args, retval)) != 0)
return error;
if ((error = copyin(fs, &bfs, sizeof(bfs))) != 0)
@ -1419,12 +1431,13 @@ svr4_32_sys_statvfs(p, v, retval)
int
svr4_32_sys_fstatvfs(p, v, retval)
struct proc *p;
svr4_32_sys_fstatvfs(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_fstatvfs_args *uap = v;
struct proc *p = l->l_proc;
struct sys_fstatfs_args fs_args;
caddr_t sg = stackgap_init(p, 0);
struct statfs *fs = stackgap_alloc(p, &sg, sizeof(struct statfs));
@ -1435,7 +1448,7 @@ svr4_32_sys_fstatvfs(p, v, retval)
SCARG(&fs_args, fd) = SCARG(uap, fd);
SCARG(&fs_args, buf) = fs;
if ((error = sys_fstatfs(p, &fs_args, retval)) != 0)
if ((error = sys_fstatfs(l, &fs_args, retval)) != 0)
return error;
if ((error = copyin(fs, &bfs, sizeof(bfs))) != 0)
@ -1448,13 +1461,14 @@ svr4_32_sys_fstatvfs(p, v, retval)
int
svr4_32_sys_statvfs64(p, v, retval)
struct proc *p;
svr4_32_sys_statvfs64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_statvfs64_args *uap = v;
struct sys_statfs_args fs_args;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
struct statfs *fs = stackgap_alloc(p, &sg, sizeof(struct statfs));
struct statfs bfs;
@ -1465,7 +1479,7 @@ svr4_32_sys_statvfs64(p, v, retval)
CHECK_ALT_EXIST(p, &sg, SCARG(&fs_args, path));
SCARG(&fs_args, buf) = fs;
if ((error = sys_statfs(p, &fs_args, retval)) != 0)
if ((error = sys_statfs(l, &fs_args, retval)) != 0)
return error;
if ((error = copyin(fs, &bfs, sizeof(bfs))) != 0)
@ -1478,12 +1492,13 @@ svr4_32_sys_statvfs64(p, v, retval)
int
svr4_32_sys_fstatvfs64(p, v, retval)
struct proc *p;
svr4_32_sys_fstatvfs64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_fstatvfs64_args *uap = v;
struct proc *p = l->l_proc;
struct sys_fstatfs_args fs_args;
caddr_t sg = stackgap_init(p, 0);
struct statfs *fs = stackgap_alloc(p, &sg, sizeof(struct statfs));
@ -1494,7 +1509,7 @@ svr4_32_sys_fstatvfs64(p, v, retval)
SCARG(&fs_args, fd) = SCARG(uap, fd);
SCARG(&fs_args, buf) = fs;
if ((error = sys_fstatfs(p, &fs_args, retval)) != 0)
if ((error = sys_fstatfs(l, &fs_args, retval)) != 0)
return error;
if ((error = copyin(fs, &bfs, sizeof(bfs))) != 0)
@ -1507,12 +1522,13 @@ svr4_32_sys_fstatvfs64(p, v, retval)
int
svr4_32_sys_alarm(p, v, retval)
struct proc *p;
svr4_32_sys_alarm(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_alarm_args *uap = v;
struct proc *p = l->l_proc;
int error;
struct itimerval *ntp, *otp, tp;
struct sys_setitimer_args sa;
@ -1532,7 +1548,7 @@ svr4_32_sys_alarm(p, v, retval)
SCARG(&sa, itv) = ntp;
SCARG(&sa, oitv) = otp;
if ((error = sys_setitimer(p, &sa, retval)) != 0)
if ((error = sys_setitimer(l, &sa, retval)) != 0)
return error;
if ((error = copyin(otp, &tp, sizeof(tp))) != 0)
@ -1548,8 +1564,8 @@ svr4_32_sys_alarm(p, v, retval)
int
svr4_32_sys_gettimeofday(p, v, retval)
struct proc *p;
svr4_32_sys_gettimeofday(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1567,8 +1583,8 @@ svr4_32_sys_gettimeofday(p, v, retval)
int
svr4_32_sys_facl(p, v, retval)
struct proc *p;
svr4_32_sys_facl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1595,18 +1611,18 @@ svr4_32_sys_facl(p, v, retval)
int
svr4_32_sys_acl(p, v, retval)
struct proc *p;
svr4_32_sys_acl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
return svr4_32_sys_facl(p, v, retval); /* XXX: for now the same */
return svr4_32_sys_facl(l, v, retval); /* XXX: for now the same */
}
int
svr4_32_sys_auditsys(p, v, retval)
struct proc *p;
svr4_32_sys_auditsys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1618,8 +1634,8 @@ svr4_32_sys_auditsys(p, v, retval)
int
svr4_32_sys_memcntl(p, v, retval)
struct proc *p;
svr4_32_sys_memcntl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1633,7 +1649,7 @@ svr4_32_sys_memcntl(p, v, retval)
SCARG(&msa, len) = SCARG(uap, len);
SCARG(&msa, flags) = (int)(u_long)SCARG(uap, arg);
return sys___msync13(p, &msa, retval);
return sys___msync13(l, &msa, retval);
}
case SVR4_MC_ADVISE:
{
@ -1643,7 +1659,7 @@ svr4_32_sys_memcntl(p, v, retval)
SCARG(&maa, len) = SCARG(uap, len);
SCARG(&maa, behav) = (int)(u_long)SCARG(uap, arg);
return sys_madvise(p, &maa, retval);
return sys_madvise(l, &maa, retval);
}
case SVR4_MC_LOCK:
case SVR4_MC_UNLOCK:
@ -1657,8 +1673,8 @@ svr4_32_sys_memcntl(p, v, retval)
int
svr4_32_sys_nice(p, v, retval)
struct proc *p;
svr4_32_sys_nice(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1670,10 +1686,10 @@ svr4_32_sys_nice(p, v, retval)
SCARG(&ap, who) = 0;
SCARG(&ap, prio) = SCARG(uap, prio);
if ((error = sys_setpriority(p, &ap, retval)) != 0)
if ((error = sys_setpriority(l, &ap, retval)) != 0)
return error;
if ((error = sys_getpriority(p, &ap, retval)) != 0)
if ((error = sys_getpriority(l, &ap, retval)) != 0)
return error;
return 0;
@ -1681,12 +1697,13 @@ svr4_32_sys_nice(p, v, retval)
int
svr4_32_sys_resolvepath(p, v, retval)
struct proc *p;
svr4_32_sys_resolvepath(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_resolvepath_args *uap = v;
struct proc *p = l->l_proc;
struct nameidata nd;
int error;
size_t len;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_net.c,v 1.5 2002/03/16 20:43:58 christos Exp $ */
/* $NetBSD: svr4_32_net.c,v 1.6 2003/01/19 16:47:14 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_net.c,v 1.5 2002/03/16 20:43:58 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_net.c,v 1.6 2003/01/19 16:47:14 thorpej Exp $");
#define COMPAT_SVR4 1
@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_net.c,v 1.5 2002/03/16 20:43:58 christos Exp
#include <sys/conf.h>
#include <sys/mount.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_resource.c,v 1.2 2001/11/13 02:09:29 lukem Exp $ */
/* $NetBSD: svr4_32_resource.c,v 1.3 2003/01/19 16:47:15 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_resource.c,v 1.2 2001/11/13 02:09:29 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_resource.c,v 1.3 2003/01/19 16:47:15 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -95,12 +95,13 @@ svr4_to_native_rl(rl)
((svr4_rlim64_t)(l)) != SVR4_RLIM64_SAVED_MAX)
int
svr4_32_sys_getrlimit(p, v, retval)
struct proc *p;
svr4_32_sys_getrlimit(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_getrlimit_args *uap = v;
struct proc *p = l->l_proc;
int rl = svr4_to_native_rl(SCARG(uap, which));
struct rlimit blim;
struct svr4_rlimit slim;
@ -142,12 +143,13 @@ svr4_32_sys_getrlimit(p, v, retval)
int
svr4_32_sys_setrlimit(p, v, retval)
struct proc *p;
svr4_32_sys_setrlimit(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_setrlimit_args *uap = v;
struct proc *p = l->l_proc;
int rl = svr4_to_native_rl(SCARG(uap, which));
struct rlimit blim, *limp;
struct svr4_rlimit slim;
@ -194,12 +196,13 @@ svr4_32_sys_setrlimit(p, v, retval)
int
svr4_32_sys_getrlimit64(p, v, retval)
struct proc *p;
svr4_32_sys_getrlimit64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_getrlimit64_args *uap = v;
struct proc *p = l->l_proc;
int rl = svr4_to_native_rl(SCARG(uap, which));
struct rlimit blim;
struct svr4_rlimit64 slim;
@ -242,12 +245,13 @@ svr4_32_sys_getrlimit64(p, v, retval)
int
svr4_32_sys_setrlimit64(p, v, retval)
struct proc *p;
svr4_32_sys_setrlimit64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_setrlimit64_args *uap = v;
struct proc *p = l->l_proc;
int rl = svr4_to_native_rl(SCARG(uap, which));
struct rlimit blim, *limp;
struct svr4_rlimit64 slim;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_signal.c,v 1.8 2002/11/27 16:44:04 atatat Exp $ */
/* $NetBSD: svr4_32_signal.c,v 1.9 2003/01/19 16:47:15 thorpej Exp $ */
/*-
* Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.8 2002/11/27 16:44:04 atatat Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.9 2003/01/19 16:47:15 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_svr4.h"
@ -56,6 +56,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.8 2002/11/27 16:44:04 atatat Ex
#include <sys/malloc.h>
#include <sys/wait.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>
@ -347,8 +348,8 @@ native_to_svr4_32_sigaltstack(bss, sss)
}
int
svr4_32_sys_sigaction(p, v, retval)
struct proc *p;
svr4_32_sys_sigaction(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -368,7 +369,7 @@ svr4_32_sys_sigaction(p, v, retval)
return (error);
svr4_32_to_native_sigaction(&nssa, &nbsa);
}
error = sigaction1(p, svr4_to_native_signo[SCARG(uap, signum)],
error = sigaction1(l->l_proc, svr4_to_native_signo[SCARG(uap, signum)],
SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
NULL, 0);
if (error)
@ -384,8 +385,8 @@ svr4_32_sys_sigaction(p, v, retval)
}
int
svr4_32_sys_sigaltstack(p, v, retval)
struct proc *p;
svr4_32_sys_sigaltstack(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -404,7 +405,7 @@ svr4_32_sys_sigaltstack(p, v, retval)
return (error);
svr4_32_to_native_sigaltstack(&nsss, &nbss);
}
error = sigaltstack1(p,
error = sigaltstack1(l->l_proc,
SCARG(uap, nss) ? &nbss : 0, SCARG(uap, oss) ? &obss : 0);
if (error)
return (error);
@ -422,8 +423,8 @@ svr4_32_sys_sigaltstack(p, v, retval)
* Stolen from the ibcs2 one
*/
int
svr4_32_sys_signal(p, v, retval)
struct proc *p;
svr4_32_sys_signal(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -431,6 +432,7 @@ svr4_32_sys_signal(p, v, retval)
syscallarg(int) signum;
syscallarg(svr4_32_sig_t) handler;
} */ *uap = v;
struct proc *p = l->l_proc;
int signum = svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))];
struct sigaction nbsa, obsa;
sigset_t ss;
@ -483,8 +485,8 @@ svr4_32_sys_signal(p, v, retval)
}
int
svr4_32_sys_sigprocmask(p, v, retval)
struct proc *p;
svr4_32_sys_sigprocmask(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -527,7 +529,7 @@ svr4_32_sys_sigprocmask(p, v, retval)
return error;
svr4_32_to_native_sigset(&nsss, &nbss);
}
error = sigprocmask1(p, how,
error = sigprocmask1(l->l_proc, how,
SCARG(uap, set) ? &nbss : NULL, SCARG(uap, oset) ? &obss : NULL);
if (error)
return error;
@ -542,8 +544,8 @@ svr4_32_sys_sigprocmask(p, v, retval)
}
int
svr4_32_sys_sigpending(p, v, retval)
struct proc *p;
svr4_32_sys_sigpending(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -556,7 +558,7 @@ svr4_32_sys_sigpending(p, v, retval)
switch (SCARG(uap, what)) {
case 1: /* sigpending */
sigpending1(p, &bss);
sigpending1(l->l_proc, &bss);
native_to_svr4_32_sigset(&bss, &sss);
break;
@ -571,8 +573,8 @@ svr4_32_sys_sigpending(p, v, retval)
}
int
svr4_32_sys_sigsuspend(p, v, retval)
struct proc *p;
svr4_32_sys_sigsuspend(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -590,22 +592,22 @@ svr4_32_sys_sigsuspend(p, v, retval)
svr4_32_to_native_sigset(&sss, &bss);
}
return (sigsuspend1(p, SCARG(uap, set) ? &bss : 0));
return (sigsuspend1(l->l_proc, SCARG(uap, set) ? &bss : 0));
}
int
svr4_32_sys_pause(p, v, retval)
struct proc *p;
svr4_32_sys_pause(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
return (sigsuspend1(p, 0));
return (sigsuspend1(l->l_proc, 0));
}
int
svr4_32_sys_kill(p, v, retval)
struct proc *p;
svr4_32_sys_kill(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -617,12 +619,12 @@ svr4_32_sys_kill(p, v, retval)
SCARG(&ka, pid) = SCARG(uap, pid);
SCARG(&ka, signum) = svr4_to_native_signo[SCARG(uap, signum)];
return sys_kill(p, &ka, retval);
return sys_kill(l, &ka, retval);
}
void
svr4_32_getcontext(p, uc, mask)
struct proc *p;
svr4_32_getcontext(l, uc, mask)
struct lwp *l;
struct svr4_32_ucontext *uc;
sigset_t *mask;
{
@ -632,10 +634,10 @@ svr4_32_getcontext(p, uc, mask)
memset(uc, 0, sizeof(*uc));
/* get machine context */
sp = svr4_32_getmcontext(p, &uc->uc_mcontext, &uc->uc_flags);
sp = svr4_32_getmcontext(l, &uc->uc_mcontext, &uc->uc_flags);
/* get link */
uc->uc_link = (u_long)p->p_ctxlink;
uc->uc_link = (u_long)l->l_ctxlink;
/* get stack state. XXX: solaris appears to do this */
#if 0
@ -653,18 +655,19 @@ svr4_32_getcontext(p, uc, mask)
int
svr4_32_setcontext(p, uc)
struct proc *p;
svr4_32_setcontext(l, uc)
struct lwp *l;
struct svr4_32_ucontext *uc;
{
int error;
struct proc *p = l->l_proc;
/* set machine context */
if ((error = svr4_32_setmcontext(p, &uc->uc_mcontext, uc->uc_flags)) != 0)
if ((error = svr4_32_setmcontext(l, &uc->uc_mcontext, uc->uc_flags)) != 0)
return error;
/* set link */
p->p_ctxlink = (caddr_t)(u_long)uc->uc_link;
l->l_ctxlink = (caddr_t)(u_long)uc->uc_link;
/* set signal stack */
if (uc->uc_flags & SVR4_UC_STACK) {
@ -684,8 +687,8 @@ svr4_32_setcontext(p, uc)
}
int
svr4_32_sys_context(p, v, retval)
struct proc *p;
svr4_32_sys_context(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -693,6 +696,7 @@ svr4_32_sys_context(p, v, retval)
syscallarg(int) func;
syscallarg(struct svr4_32_ucontext *) uc;
} */ *uap = v;
struct proc *p = l->l_proc;
struct svr4_32_ucontext uc;
int error;
*retval = 0;
@ -700,18 +704,18 @@ svr4_32_sys_context(p, v, retval)
switch (SCARG(uap, func)) {
case SVR4_GETCONTEXT:
DPRINTF(("getcontext(%p)\n", SCARG(uap, uc)));
svr4_32_getcontext(p, &uc, &p->p_sigctx.ps_sigmask);
svr4_32_getcontext(l, &uc, &p->p_sigctx.ps_sigmask);
return copyout(&uc, (caddr_t)(u_long)SCARG(uap, uc), sizeof(uc));
case SVR4_SETCONTEXT:
DPRINTF(("setcontext(%p)\n", SCARG(uap, uc)));
if (SCARG(uap, uc) == NULL)
exit1(p, W_EXITCODE(0, 0));
exit1(l, W_EXITCODE(0, 0));
else if ((error = copyin((caddr_t)(u_long)SCARG(uap, uc),
&uc, sizeof(uc))) != 0)
return error;
else
return svr4_32_setcontext(p, &uc);
return svr4_32_setcontext(l, &uc);
default:
DPRINTF(("context(%d, %p)\n", SCARG(uap, func),

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_socket.c,v 1.3 2002/07/22 05:31:18 matt Exp $ */
/* $NetBSD: svr4_32_socket.c,v 1.4 2003/01/19 16:47:15 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.3 2002/07/22 05:31:18 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.4 2003/01/19 16:47:15 thorpej Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -59,6 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.3 2002/07/22 05:31:18 matt Exp
#include <sys/mount.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <sys/un.h>
#include <sys/stat.h>
@ -187,8 +188,8 @@ svr4_32_add_socket(p, path, st)
#endif
int
svr4_32_sys_socket(p, v, retval)
struct proc *p;
svr4_32_sys_socket(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -224,5 +225,5 @@ svr4_32_sys_socket(p, v, retval)
default:
return EINVAL;
}
return sys_socket(p, &uap0, retval);
return sys_socket(l, &uap0, retval);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_sockio.c,v 1.3 2002/07/22 05:31:18 matt Exp $ */
/* $NetBSD: svr4_32_sockio.c,v 1.4 2003/01/19 16:47:15 thorpej Exp $ */
/*-
* Copyright (c) 1995 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.3 2002/07/22 05:31:18 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.4 2003/01/19 16:47:15 thorpej Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.3 2002/07/22 05:31:18 matt Exp
#include <net/if.h>
#include <sys/malloc.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>
@ -90,14 +91,15 @@ bsd_to_svr4_flags(bf)
}
int
svr4_32_sock_ioctl(fp, p, retval, fd, cmd, data)
svr4_32_sock_ioctl(fp, l, retval, fd, cmd, data)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
caddr_t data;
{
struct proc *p = l->l_proc;
int error;
int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *)) =
fp->f_ops->fo_ioctl;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_stat.c,v 1.6 2002/12/22 02:54:35 mrg Exp $ */
/* $NetBSD: svr4_32_stat.c,v 1.7 2003/01/19 16:47:16 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.6 2002/12/22 02:54:35 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.7 2003/01/19 16:47:16 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -57,6 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.6 2002/12/22 02:54:35 mrg Exp $")
#include <uvm/uvm_extern.h>
#include <sys/sysctl.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>
@ -83,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.6 2002/12/22 02:54:35 mrg Exp $")
static void bsd_to_svr4_32_xstat __P((struct stat *, struct svr4_32_xstat *));
static void bsd_to_svr4_32_stat64 __P((struct stat *, struct svr4_32_stat64 *));
int svr4_32_ustat __P((struct proc *, void *, register_t *));
int svr4_32_ustat __P((struct lwp *, void *, register_t *));
static int svr4_32_to_bsd_pathconf __P((int));
/*
@ -169,8 +170,8 @@ bsd_to_svr4_32_stat64(st, st4)
int
svr4_32_sys_stat(p, v, retval)
struct proc *p;
svr4_32_sys_stat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -185,8 +186,9 @@ svr4_32_sys_stat(p, v, retval)
SCARG(&cup, two) = 2;
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = SCARG(uap, ub);
return svr4_32_sys_xstat(p, &cup, retval);
return svr4_32_sys_xstat(l, &cup, retval);
#else
struct proc *p = l->l_proc;
struct stat st;
struct svr4_32_stat svr4_st;
struct sys___stat13_args cup;
@ -219,8 +221,8 @@ svr4_32_sys_stat(p, v, retval)
int
svr4_32_sys_lstat(p, v, retval)
struct proc *p;
svr4_32_sys_lstat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -235,7 +237,7 @@ svr4_32_sys_lstat(p, v, retval)
SCARG(&cup, two) = 2;
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = SCARG(uap, ub);
return svr4_32_sys_lxstat(p, &cup, retval);
return svr4_32_sys_lxstat(l, &cup, retval);
#else
struct stat st;
struct svr4_32_stat svr4_st;
@ -268,8 +270,8 @@ svr4_32_sys_lstat(p, v, retval)
int
svr4_32_sys_fstat(p, v, retval)
struct proc *p;
svr4_32_sys_fstat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -280,7 +282,7 @@ svr4_32_sys_fstat(p, v, retval)
SCARG(&cup, two) = 2;
SCARG(&cup, fd) = SCARG(uap, fd);
SCARG(&cup, sb) = SCARG(uap, sb);
return svr4_32_sys_fxstat(p, &cup, retval);
return svr4_32_sys_fxstat(l, &cup, retval);
#else
struct stat st;
struct svr4_32_stat svr4_st;
@ -310,12 +312,13 @@ svr4_32_sys_fstat(p, v, retval)
int
svr4_32_sys_xstat(p, v, retval)
struct proc *p;
svr4_32_sys_xstat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_xstat_args *uap = v;
struct proc *p = l->l_proc;
struct stat st;
struct svr4_32_xstat svr4_st;
struct sys___stat13_args cup;
@ -327,7 +330,7 @@ svr4_32_sys_xstat(p, v, retval)
SCARG(&cup, path) = (const char *)(u_long)SCARG(uap, path);
CHECK_ALT_EXIST(p, &sg, SCARG(&cup, path));
if ((error = sys___stat13(p, &cup, retval)) != 0)
if ((error = sys___stat13(l, &cup, retval)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@ -348,12 +351,13 @@ svr4_32_sys_xstat(p, v, retval)
int
svr4_32_sys_lxstat(p, v, retval)
struct proc *p;
svr4_32_sys_lxstat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_lxstat_args *uap = v;
struct proc *p = l->l_proc;
struct stat st;
struct svr4_32_xstat svr4_st;
struct sys___lstat13_args cup;
@ -365,7 +369,7 @@ svr4_32_sys_lxstat(p, v, retval)
SCARG(&cup, path) = (const char *)(u_long)SCARG(uap, path);
CHECK_ALT_EXIST(p, &sg, SCARG(&cup, path));
if ((error = sys___lstat13(p, &cup, retval)) != 0)
if ((error = sys___lstat13(l, &cup, retval)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@ -386,12 +390,13 @@ svr4_32_sys_lxstat(p, v, retval)
int
svr4_32_sys_fxstat(p, v, retval)
struct proc *p;
svr4_32_sys_fxstat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_fxstat_args *uap = v;
struct proc *p = l->l_proc;
struct stat st;
struct svr4_32_xstat svr4_st;
struct sys___fstat13_args cup;
@ -402,7 +407,7 @@ svr4_32_sys_fxstat(p, v, retval)
SCARG(&cup, fd) = SCARG(uap, fd);
SCARG(&cup, sb) = stackgap_alloc(p, &sg, sizeof(struct stat));
if ((error = sys___fstat13(p, &cup, retval)) != 0)
if ((error = sys___fstat13(l, &cup, retval)) != 0)
return error;
if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0)
@ -419,12 +424,13 @@ svr4_32_sys_fxstat(p, v, retval)
int
svr4_32_sys_stat64(p, v, retval)
struct proc *p;
svr4_32_sys_stat64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_stat64_args *uap = v;
struct proc *p = l->l_proc;
struct stat st;
struct svr4_32_stat64 svr4_st;
struct sys___stat13_args cup;
@ -436,7 +442,7 @@ svr4_32_sys_stat64(p, v, retval)
SCARG(&cup, path) = (const char *)(u_long)SCARG(uap, path);
CHECK_ALT_EXIST(p, &sg, SCARG(&cup, path));
if ((error = sys___stat13(p, &cup, retval)) != 0)
if ((error = sys___stat13(l, &cup, retval)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@ -457,12 +463,13 @@ svr4_32_sys_stat64(p, v, retval)
int
svr4_32_sys_lstat64(p, v, retval)
struct proc *p;
svr4_32_sys_lstat64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_lstat64_args *uap = v;
struct proc *p = l->l_proc;
struct stat st;
struct svr4_32_stat64 svr4_st;
struct sys___lstat13_args cup;
@ -474,7 +481,7 @@ svr4_32_sys_lstat64(p, v, retval)
SCARG(&cup, path) = (const char *)(u_long)SCARG(uap, path);
CHECK_ALT_EXIST(p, &sg, SCARG(&cup, path));
if ((error = sys___lstat13(p, &cup, retval)) != 0)
if ((error = sys___lstat13(l, &cup, retval)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@ -495,12 +502,13 @@ svr4_32_sys_lstat64(p, v, retval)
int
svr4_32_sys_fstat64(p, v, retval)
struct proc *p;
svr4_32_sys_fstat64(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_fstat64_args *uap = v;
struct proc *p = l->l_proc;
struct stat st;
struct svr4_32_stat64 svr4_st;
struct sys___fstat13_args cup;
@ -511,7 +519,7 @@ svr4_32_sys_fstat64(p, v, retval)
SCARG(&cup, fd) = SCARG(uap, fd);
SCARG(&cup, sb) = stackgap_alloc(p, &sg, sizeof(struct stat));
if ((error = sys___fstat13(p, &cup, retval)) != 0)
if ((error = sys___fstat13(l, &cup, retval)) != 0)
return error;
if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0)
@ -533,8 +541,8 @@ struct svr4_32_ustat_args {
};
int
svr4_32_ustat(p, v, retval)
struct proc *p;
svr4_32_ustat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -561,8 +569,8 @@ svr4_32_ustat(p, v, retval)
int
svr4_32_sys_uname(p, v, retval)
struct proc *p;
svr4_32_sys_uname(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -592,12 +600,13 @@ svr4_32_sys_uname(p, v, retval)
int
svr4_32_sys_systeminfo(p, v, retval)
struct proc *p;
svr4_32_sys_systeminfo(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_systeminfo_args *uap = v;
struct proc *p = l->l_proc;
const char *str = NULL;
int name;
int error;
@ -712,8 +721,8 @@ svr4_32_sys_systeminfo(p, v, retval)
int
svr4_32_sys_utssys(p, v, retval)
struct proc *p;
svr4_32_sys_utssys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -724,7 +733,7 @@ svr4_32_sys_utssys(p, v, retval)
{
struct svr4_32_sys_uname_args ua;
SCARG(&ua, name) = SCARG(uap, a1);
return svr4_32_sys_uname(p, &ua, retval);
return svr4_32_sys_uname(l, &ua, retval);
}
case 2: /* ustat(2) */
@ -732,7 +741,7 @@ svr4_32_sys_utssys(p, v, retval)
struct svr4_32_ustat_args ua;
SCARG(&ua, dev) = (svr4_32_dev_t) SCARG(uap, a2);
SCARG(&ua, name) = SCARG(uap, a1);
return svr4_32_ustat(p, &ua, retval);
return svr4_32_ustat(l, &ua, retval);
}
case 3: /* fusers(2) */
@ -746,12 +755,13 @@ svr4_32_sys_utssys(p, v, retval)
int
svr4_32_sys_utime(p, v, retval)
struct proc *p;
svr4_32_sys_utime(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_utime_args *uap = v;
struct proc *p = l->l_proc;
struct svr4_32_utimbuf ub;
struct timeval tbuf[2];
struct sys_utimes_args ap;
@ -777,24 +787,25 @@ svr4_32_sys_utime(p, v, retval)
}
else
SCARG(&ap, tptr) = NULL;
return sys_utimes(p, &ap, retval);
return sys_utimes(l, &ap, retval);
}
int
svr4_32_sys_utimes(p, v, retval)
struct proc *p;
svr4_32_sys_utimes(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_utimes_args *uap = v;
struct proc *p = l->l_proc;
struct sys_utimes_args ua;
caddr_t sg = stackgap_init(p, 0);
SCARG(&ua, path) = (const char *)(u_long)SCARG(uap, path);
CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
SCARG(&ua, tptr) = (const struct timeval *)(u_long)SCARG(uap, tptr);
return sys_utimes(p, &ua, retval);
return sys_utimes(l, &ua, retval);
}
@ -849,12 +860,13 @@ svr4_32_to_bsd_pathconf(name)
int
svr4_32_sys_pathconf(p, v, retval)
struct proc *p;
svr4_32_sys_pathconf(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_pathconf_args *uap = v;
struct proc *p = l->l_proc;
struct sys_pathconf_args /* {
syscallarg(char *) path;
syscallarg(int) name;
@ -875,14 +887,14 @@ svr4_32_sys_pathconf(p, v, retval)
*retval = 0;
return 0;
default:
return sys_pathconf(p, uap, retval);
return sys_pathconf(l, uap, retval);
}
}
int
svr4_32_sys_fpathconf(p, v, retval)
struct proc *p;
svr4_32_sys_fpathconf(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -898,6 +910,6 @@ svr4_32_sys_fpathconf(p, v, retval)
*retval = 0;
return 0;
default:
return sys_fpathconf(p, uap, retval);
return sys_fpathconf(l, uap, retval);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_stream.c,v 1.9 2002/03/16 20:43:58 christos Exp $ */
/* $NetBSD: svr4_32_stream.c,v 1.10 2003/01/19 16:47:16 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_stream.c,v 1.9 2002/03/16 20:43:58 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_stream.c,v 1.10 2003/01/19 16:47:16 thorpej Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -67,6 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_stream.c,v 1.9 2002/03/16 20:43:58 christos
#include <sys/device.h>
#include <sys/stat.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>
@ -83,7 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_stream.c,v 1.9 2002/03/16 20:43:58 christos
/* Utils */
static int clean_pipe __P((struct proc *, const char *));
static int clean_pipe __P((struct lwp *, const char *));
static void getparm __P((struct file *, struct svr4_si_sockparms *));
/* Address Conversions */
@ -97,42 +98,43 @@ static void netaddr_to_sockaddr_un __P((struct sockaddr_un *,
const struct svr4_32_strmcmd *));
/* stream ioctls */
static int i_nread __P((struct file *, struct proc *, register_t *, int,
static int i_nread __P((struct file *, struct lwp *, register_t *, int,
u_long, caddr_t));
static int i_fdinsert __P((struct file *, struct proc *, register_t *, int,
static int i_fdinsert __P((struct file *, struct lwp *, register_t *, int,
u_long, caddr_t));
static int i_str __P((struct file *, struct proc *, register_t *, int,
static int i_str __P((struct file *, struct lwp *, register_t *, int,
u_long, caddr_t));
static int i_setsig __P((struct file *, struct proc *, register_t *, int,
static int i_setsig __P((struct file *, struct lwp *, register_t *, int,
u_long, caddr_t));
static int i_getsig __P((struct file *, struct proc *, register_t *, int,
static int i_getsig __P((struct file *, struct lwp *, register_t *, int,
u_long, caddr_t));
static int _i_bind_rsvd __P((struct file *, struct proc *, register_t *, int,
static int _i_bind_rsvd __P((struct file *, struct lwp *, register_t *, int,
u_long, caddr_t));
static int _i_rele_rsvd __P((struct file *, struct proc *, register_t *, int,
static int _i_rele_rsvd __P((struct file *, struct lwp *, register_t *, int,
u_long, caddr_t));
/* i_str sockmod calls */
static int sockmod __P((struct file *, int, struct svr4_32_strioctl *,
struct proc *));
struct lwp *));
static int si_listen __P((struct file *, int, struct svr4_32_strioctl *,
struct proc *));
struct lwp *));
static int si_ogetudata __P((struct file *, int, struct svr4_32_strioctl *,
struct proc *));
struct lwp *));
static int si_sockparams __P((struct file *, int, struct svr4_32_strioctl *,
struct proc *));
struct lwp *));
static int si_shutdown __P((struct file *, int, struct svr4_32_strioctl *,
struct proc *));
struct lwp *));
static int si_getudata __P((struct file *, int, struct svr4_32_strioctl *,
struct proc *));
struct lwp *));
/* i_str timod calls */
static int timod __P((struct file *, int, struct svr4_32_strioctl *,
struct proc *));
struct lwp *));
static int ti_getinfo __P((struct file *, int, struct svr4_32_strioctl *,
struct proc *));
struct lwp *));
static int ti_bind __P((struct file *, int, struct svr4_32_strioctl *,
struct proc *));
struct lwp *));
#ifdef DEBUG_SVR4
static void bufprint __P((u_char *, size_t));
@ -273,28 +275,29 @@ show_msg(str, fd, ctl, dat, flags)
* to avoid code duplication.
*/
static int
clean_pipe(p, path)
struct proc *p;
clean_pipe(l, path)
struct lwp *l;
const char *path;
{
struct sys___lstat13_args la;
struct proc *p = l->l_proc;
struct sys_unlink_args ua;
register_t retval;
struct stat st;
int error;
caddr_t sg = stackgap_init(p, 0);
size_t l = strlen(path) + 1;
size_t len = strlen(path) + 1;
void *tpath;
tpath = stackgap_alloc(p, &sg, l);
tpath = stackgap_alloc(p, &sg, len);
SCARG(&la, ub) = stackgap_alloc(p, &sg, sizeof(struct stat));
if ((error = copyout(path, tpath, l)) != 0)
if ((error = copyout(path, tpath, len)) != 0)
return error;
SCARG(&la, path) = tpath;
if ((error = sys___lstat13(p, &la, &retval)) != 0)
if ((error = sys___lstat13(l, &la, &retval)) != 0)
return 0;
if ((error = copyin(SCARG(&la, ub), &st, sizeof(st))) != 0)
@ -311,7 +314,7 @@ clean_pipe(p, path)
SCARG(&ua, path) = SCARG(&la, path);
if ((error = sys_unlink(p, &ua, &retval)) != 0) {
if ((error = sys_unlink(l, &ua, &retval)) != 0) {
DPRINTF(("clean_pipe: unlink failed %d\n", error));
return error;
}
@ -319,7 +322,6 @@ clean_pipe(p, path)
return 0;
}
static void
sockaddr_to_netaddr_in(sc, sain)
struct svr4_32_strmcmd *sc;
@ -394,7 +396,6 @@ netaddr_to_sockaddr_un(saun, sc)
saun->sun_path));
}
static void
getparm(fp, pa)
struct file *fp;
@ -435,13 +436,12 @@ getparm(fp, pa)
}
}
static int
si_ogetudata(fp, fd, ioc, p)
si_ogetudata(fp, fd, ioc, l)
struct file *fp;
int fd;
struct svr4_32_strioctl *ioc;
struct proc *p;
struct lwp *l;
{
int error;
struct svr4_si_oudata ud;
@ -494,11 +494,11 @@ si_ogetudata(fp, fd, ioc, p)
static int
si_sockparams(fp, fd, ioc, p)
si_sockparams(fp, fd, ioc, l)
struct file *fp;
int fd;
struct svr4_32_strioctl *ioc;
struct proc *p;
struct lwp *l;
{
struct svr4_si_sockparms pa;
@ -508,11 +508,11 @@ si_sockparams(fp, fd, ioc, p)
static int
si_listen(fp, fd, ioc, p)
si_listen(fp, fd, ioc, l)
struct file *fp;
int fd;
struct svr4_32_strioctl *ioc;
struct proc *p;
struct lwp *l;
{
int error;
struct svr4_strm *st = svr4_32_stream_get(fp);
@ -541,7 +541,7 @@ si_listen(fp, fd, ioc, p)
DPRINTF(("SI_LISTEN: fileno %d backlog = %d\n", fd, 5));
SCARG(&la, backlog) = 5;
if ((error = sys_listen(p, &la, &retval)) != 0) {
if ((error = sys_listen(l, &la, &retval)) != 0) {
DPRINTF(("SI_LISTEN: listen failed %d\n", error));
return error;
}
@ -576,11 +576,11 @@ si_listen(fp, fd, ioc, p)
static int
si_getudata(fp, fd, ioc, p)
si_getudata(fp, fd, ioc, l)
struct file *fp;
int fd;
struct svr4_32_strioctl *ioc;
struct proc *p;
struct lwp *l;
{
int error;
struct svr4_si_udata ud;
@ -633,11 +633,11 @@ si_getudata(fp, fd, ioc, p)
static int
si_shutdown(fp, fd, ioc, p)
si_shutdown(fp, fd, ioc, l)
struct file *fp;
int fd;
struct svr4_32_strioctl *ioc;
struct proc *p;
struct lwp *l;
{
int error;
struct sys_shutdown_args ap;
@ -654,29 +654,28 @@ si_shutdown(fp, fd, ioc, p)
SCARG(&ap, s) = fd;
return sys_shutdown(p, &ap, &retval);
return sys_shutdown(l, &ap, &retval);
}
static int
sockmod(fp, fd, ioc, p)
sockmod(fp, fd, ioc, l)
struct file *fp;
int fd;
struct svr4_32_strioctl *ioc;
struct proc *p;
struct lwp *l;
{
switch (ioc->cmd) {
case SVR4_SI_OGETUDATA:
DPRINTF(("SI_OGETUDATA\n"));
return si_ogetudata(fp, fd, ioc, p);
return si_ogetudata(fp, fd, ioc, l);
case SVR4_SI_SHUTDOWN:
DPRINTF(("SI_SHUTDOWN\n"));
return si_shutdown(fp, fd, ioc, p);
return si_shutdown(fp, fd, ioc, l);
case SVR4_SI_LISTEN:
DPRINTF(("SI_LISTEN\n"));
return si_listen(fp, fd, ioc, p);
return si_listen(fp, fd, ioc, l);
case SVR4_SI_SETMYNAME:
DPRINTF(("SI_SETMYNAME\n"));
@ -700,11 +699,11 @@ sockmod(fp, fd, ioc, p)
case SVR4_SI_SOCKPARAMS:
DPRINTF(("SI_SOCKPARAMS\n"));
return si_sockparams(fp, fd, ioc, p);
return si_sockparams(fp, fd, ioc, l);
case SVR4_SI_GETUDATA:
DPRINTF(("SI_GETUDATA\n"));
return si_getudata(fp, fd, ioc, p);
return si_getudata(fp, fd, ioc, l);
default:
DPRINTF(("Unknown sockmod ioctl %lx\n", ioc->cmd));
@ -713,13 +712,12 @@ sockmod(fp, fd, ioc, p)
}
}
static int
ti_getinfo(fp, fd, ioc, p)
ti_getinfo(fp, fd, ioc, l)
struct file *fp;
int fd;
struct svr4_32_strioctl *ioc;
struct proc *p;
struct lwp *l;
{
int error;
struct svr4_32_infocmd info;
@ -756,13 +754,14 @@ ti_getinfo(fp, fd, ioc, p)
static int
ti_bind(fp, fd, ioc, p)
ti_bind(fp, fd, ioc, l)
struct file *fp;
int fd;
struct svr4_32_strioctl *ioc;
struct proc *p;
struct lwp *l;
{
int error;
struct proc *p = l->l_proc;
struct svr4_strm *st = svr4_32_stream_get(fp);
struct sockaddr_in sain;
struct sockaddr_un saun;
@ -818,7 +817,7 @@ ti_bind(fp, fd, ioc, p)
DPRINTF(("TI_BIND: fam %d, path %s\n",
saun.sun_family, saun.sun_path));
if ((error = clean_pipe(p, saun.sun_path)) != 0)
if ((error = clean_pipe(l, saun.sun_path)) != 0)
return error;
bnd.pad[28] = 0x00001000; /* magic again */
@ -841,7 +840,7 @@ ti_bind(fp, fd, ioc, p)
SCARG(&ba, name) = (void *) sup;
SCARG(&ba, namelen) = sasize;
if ((error = sys_bind(p, &ba, &retval)) != 0) {
if ((error = sys_bind(l, &ba, &retval)) != 0) {
DPRINTF(("TI_BIND: bind failed %d\n", error));
return error;
}
@ -863,16 +862,16 @@ reply:
static int
timod(fp, fd, ioc, p)
timod(fp, fd, ioc, l)
struct file *fp;
int fd;
struct svr4_32_strioctl *ioc;
struct proc *p;
struct lwp *l;
{
switch (ioc->cmd) {
case SVR4_TI_GETINFO:
DPRINTF(("TI_GETINFO\n"));
return ti_getinfo(fp, fd, ioc, p);
return ti_getinfo(fp, fd, ioc, l);
case SVR4_TI_OPTMGMT:
DPRINTF(("TI_OPTMGMT\n"));
@ -880,7 +879,7 @@ timod(fp, fd, ioc, p)
case SVR4_TI_BIND:
DPRINTF(("TI_BIND\n"));
return ti_bind(fp, fd, ioc, p);
return ti_bind(fp, fd, ioc, l);
case SVR4_TI_UNBIND:
DPRINTF(("TI_UNBIND\n"));
@ -892,16 +891,16 @@ timod(fp, fd, ioc, p)
}
}
int
svr4_32_stream_ti_ioctl(fp, p, retval, fd, cmd, dat)
svr4_32_stream_ti_ioctl(fp, l, retval, fd, cmd, dat)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
caddr_t dat;
{
struct proc *p = l->l_proc;
struct svr4_32_strbuf skb, *sub = (struct svr4_32_strbuf *) dat;
struct svr4_strm *st = svr4_32_stream_get(fp);
int error;
@ -957,7 +956,7 @@ svr4_32_stream_ti_ioctl(fp, p, retval, fd, cmd, dat)
SCARG(&ap, fdes) = fd;
SCARG(&ap, asa) = sup;
SCARG(&ap, alen) = lenp;
if ((error = sys_getsockname(p, &ap, retval)) != 0) {
if ((error = sys_getsockname(l, &ap, retval)) != 0) {
DPRINTF(("ti_ioctl: getsockname error\n"));
return error;
}
@ -971,7 +970,7 @@ svr4_32_stream_ti_ioctl(fp, p, retval, fd, cmd, dat)
SCARG(&ap, fdes) = fd;
SCARG(&ap, asa) = sup;
SCARG(&ap, alen) = lenp;
if ((error = sys_getpeername(p, &ap, retval)) != 0) {
if ((error = sys_getpeername(l, &ap, retval)) != 0) {
DPRINTF(("ti_ioctl: getpeername error\n"));
return error;
}
@ -1032,12 +1031,10 @@ svr4_32_stream_ti_ioctl(fp, p, retval, fd, cmd, dat)
}
static int
i_nread(fp, p, retval, fd, cmd, dat)
i_nread(fp, l, retval, fd, cmd, dat)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
@ -1054,7 +1051,7 @@ i_nread(fp, p, retval, fd, cmd, dat)
* message waiting for us.
*/
if ((error = (*fp->f_ops->fo_ioctl)(fp, FIONREAD,
(caddr_t) &nread, p)) != 0)
(caddr_t) &nread, l->l_proc)) != 0)
return error;
if (nread != 0)
@ -1066,9 +1063,9 @@ i_nread(fp, p, retval, fd, cmd, dat)
}
static int
i_fdinsert(fp, p, retval, fd, cmd, dat)
i_fdinsert(fp, l, retval, fd, cmd, dat)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
@ -1106,7 +1103,7 @@ i_fdinsert(fp, p, retval, fd, cmd, dat)
SCARG(&d2p, from) = st->s_afd;
SCARG(&d2p, to) = fdi.fd;
if ((error = sys_dup2(p, &d2p, retval)) != 0) {
if ((error = sys_dup2(l, &d2p, retval)) != 0) {
DPRINTF(("fdinsert: dup2(%d, %d) failed %d\n",
st->s_afd, fdi.fd, error));
return error;
@ -1114,7 +1111,7 @@ i_fdinsert(fp, p, retval, fd, cmd, dat)
SCARG(&clp, fd) = st->s_afd;
if ((error = sys_close(p, &clp, retval)) != 0) {
if ((error = sys_close(l, &clp, retval)) != 0) {
DPRINTF(("fdinsert: close(%d) failed %d\n",
st->s_afd, error));
return error;
@ -1128,9 +1125,9 @@ i_fdinsert(fp, p, retval, fd, cmd, dat)
static int
_i_bind_rsvd(fp, p, retval, fd, cmd, dat)
_i_bind_rsvd(fp, l, retval, fd, cmd, dat)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
@ -1148,13 +1145,13 @@ _i_bind_rsvd(fp, p, retval, fd, cmd, dat)
SCARG(&ap, path) = dat;
SCARG(&ap, mode) = S_IFIFO;
return sys_mkfifo(p, &ap, retval);
return sys_mkfifo(l, &ap, retval);
}
static int
_i_rele_rsvd(fp, p, retval, fd, cmd, dat)
_i_rele_rsvd(fp, l, retval, fd, cmd, dat)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
@ -1168,13 +1165,13 @@ _i_rele_rsvd(fp, p, retval, fd, cmd, dat)
*/
SCARG(&ap, path) = dat;
return sys_unlink(p, &ap, retval);
return sys_unlink(l, &ap, retval);
}
static int
i_str(fp, p, retval, fd, cmd, dat)
i_str(fp, l, retval, fd, cmd, dat)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
@ -1199,12 +1196,12 @@ i_str(fp, p, retval, fd, cmd, dat)
switch (ioc.cmd & 0xff00) {
case SVR4_SIMOD:
if ((error = sockmod(fp, fd, &ioc, p)) != 0)
if ((error = sockmod(fp, fd, &ioc, l)) != 0)
return error;
break;
case SVR4_TIMOD:
if ((error = timod(fp, fd, &ioc, p)) != 0)
if ((error = timod(fp, fd, &ioc, l)) != 0)
return error;
break;
@ -1222,9 +1219,9 @@ i_str(fp, p, retval, fd, cmd, dat)
}
static int
i_setsig(fp, p, retval, fd, cmd, dat)
i_setsig(fp, l, retval, fd, cmd, dat)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
@ -1250,7 +1247,7 @@ i_setsig(fp, p, retval, fd, cmd, dat)
/* get old status flags */
SCARG(&fa, fd) = fd;
SCARG(&fa, cmd) = F_GETFL;
if ((error = sys_fcntl(p, &fa, &oflags)) != 0)
if ((error = sys_fcntl(l, &fa, &oflags)) != 0)
return error;
/* update the flags */
@ -1274,23 +1271,23 @@ i_setsig(fp, p, retval, fd, cmd, dat)
if (flags != oflags) {
SCARG(&fa, cmd) = F_SETFL;
SCARG(&fa, arg) = (void *) flags;
if ((error = sys_fcntl(p, &fa, &flags)) != 0)
if ((error = sys_fcntl(l, &fa, &flags)) != 0)
return error;
}
/* set up SIGIO receiver if needed */
if (dat != NULL) {
SCARG(&fa, cmd) = F_SETOWN;
SCARG(&fa, arg) = (void *)(u_long)p->p_pid;
return sys_fcntl(p, &fa, &flags);
SCARG(&fa, arg) = (void *)(u_long)l->l_proc->p_pid;
return sys_fcntl(l, &fa, &flags);
}
return 0;
}
static int
i_getsig(fp, p, retval, fd, cmd, dat)
i_getsig(fp, l, retval, fd, cmd, dat)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
@ -1315,23 +1312,22 @@ i_getsig(fp, p, retval, fd, cmd, dat)
}
int
svr4_32_stream_ioctl(fp, p, retval, fd, cmd, dat)
svr4_32_stream_ioctl(fp, l, retval, fd, cmd, dat)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
caddr_t dat;
{
*retval = 0;
/*
* All the following stuff assumes "sockmod" is pushed...
*/
switch (cmd) {
case SVR4_I_NREAD:
DPRINTF(("I_NREAD\n"));
return i_nread(fp, p, retval, fd, cmd, dat);
return i_nread(fp, l, retval, fd, cmd, dat);
case SVR4_I_PUSH:
DPRINTF(("I_PUSH\n"));
@ -1359,15 +1355,15 @@ svr4_32_stream_ioctl(fp, p, retval, fd, cmd, dat)
case SVR4_I_STR:
DPRINTF(("I_STR\n"));
return i_str(fp, p, retval, fd, cmd, dat);
return i_str(fp, l, retval, fd, cmd, dat);
case SVR4_I_SETSIG:
DPRINTF(("I_SETSIG\n"));
return i_setsig(fp, p, retval, fd, cmd, dat);
return i_setsig(fp, l, retval, fd, cmd, dat);
case SVR4_I_GETSIG:
DPRINTF(("I_GETSIG\n"));
return i_getsig(fp, p, retval, fd, cmd, dat);
return i_getsig(fp, l, retval, fd, cmd, dat);
case SVR4_I_FIND:
DPRINTF(("I_FIND\n"));
@ -1396,7 +1392,7 @@ svr4_32_stream_ioctl(fp, p, retval, fd, cmd, dat)
case SVR4_I_FDINSERT:
DPRINTF(("I_FDINSERT\n"));
return i_fdinsert(fp, p, retval, fd, cmd, dat);
return i_fdinsert(fp, l, retval, fd, cmd, dat);
case SVR4_I_SENDFD:
DPRINTF(("I_SENDFD\n"));
@ -1472,17 +1468,16 @@ svr4_32_stream_ioctl(fp, p, retval, fd, cmd, dat)
case SVR4__I_BIND_RSVD:
DPRINTF(("_I_BIND_RSVD\n"));
return _i_bind_rsvd(fp, p, retval, fd, cmd, dat);
return _i_bind_rsvd(fp, l, retval, fd, cmd, dat);
case SVR4__I_RELE_RSVD:
DPRINTF(("_I_RELE_RSVD\n"));
return _i_rele_rsvd(fp, p, retval, fd, cmd, dat);
return _i_rele_rsvd(fp, l, retval, fd, cmd, dat);
default:
DPRINTF(("unimpl cmd = %lx\n", cmd));
break;
}
return 0;
}
@ -1490,12 +1485,13 @@ svr4_32_stream_ioctl(fp, p, retval, fd, cmd, dat)
int
svr4_32_sys_putmsg(p, v, retval)
struct proc *p;
svr4_32_sys_putmsg(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_putmsg_args *uap = v;
struct proc *p = l->l_proc;
struct filedesc *fdp = p->p_fd;
struct file *fp;
struct svr4_32_strbuf dat, ctl;
@ -1624,7 +1620,7 @@ svr4_32_sys_putmsg(p, v, retval)
SCARG(&co, s) = SCARG(uap, fd);
SCARG(&co, name) = (void *) sup;
SCARG(&co, namelen) = (int) sasize;
return sys_connect(p, &co, retval);
return sys_connect(l, &co, retval);
}
case SVR4_TI_SENDTO_REQUEST: /* sendto */
@ -1655,12 +1651,13 @@ svr4_32_sys_putmsg(p, v, retval)
int
svr4_32_sys_getmsg(p, v, retval)
struct proc *p;
svr4_32_sys_getmsg(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct svr4_32_sys_getmsg_args *uap = v;
struct proc *p = l->l_proc;
struct filedesc *fdp = p->p_fd;
struct file *fp;
struct sys_getpeername_args ga;
@ -1774,7 +1771,7 @@ svr4_32_sys_getmsg(p, v, retval)
SCARG(&ga, asa) = (void *) sup;
SCARG(&ga, alen) = flen;
if ((error = sys_getpeername(p, &ga, retval)) != 0) {
if ((error = sys_getpeername(l, &ga, retval)) != 0) {
DPRINTF(("getmsg: getpeername failed %d\n", error));
return error;
}
@ -1833,7 +1830,7 @@ svr4_32_sys_getmsg(p, v, retval)
SCARG(&aa, name) = (void *) sup;
SCARG(&aa, anamelen) = flen;
if ((error = sys_accept(p, &aa, retval)) != 0) {
if ((error = sys_accept(l, &aa, retval)) != 0) {
DPRINTF(("getmsg: accept failed %d\n", error));
return error;
}

View File

@ -1,14 +1,14 @@
/* $NetBSD: svr4_32_sysent.c,v 1.8 2003/01/18 23:43:25 thorpej Exp $ */
/* $NetBSD: svr4_32_sysent.c,v 1.9 2003/01/19 16:47:16 thorpej Exp $ */
/*
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
* created from NetBSD: syscalls.master,v 1.5 2001/08/15 05:18:12 eeh Exp
* created from NetBSD: syscalls.master,v 1.2.4.3 2002/05/29 21:33:07 nathanw Exp
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_sysent.c,v 1.8 2003/01/18 23:43:25 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_sysent.c,v 1.9 2003/01/19 16:47:16 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ntp.h"
@ -19,6 +19,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_sysent.c,v 1.8 2003/01/18 23:43:25 thorpej E
#include <sys/signal.h>
#include <sys/mount.h>
#include <sys/poll.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_termios.c,v 1.2 2001/11/13 02:09:32 lukem Exp $ */
/* $NetBSD: svr4_32_termios.c,v 1.3 2003/01/19 16:47:16 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_32_termios.c,v 1.2 2001/11/13 02:09:32 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_32_termios.c,v 1.3 2003/01/19 16:47:16 thorpej Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_termios.c,v 1.2 2001/11/13 02:09:32 lukem Ex
#include <net/if.h>
#include <sys/malloc.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>
@ -502,14 +503,15 @@ svr4_32_termios_to_termio(ts, t)
}
int
svr4_32_term_ioctl(fp, p, retval, fd, cmd, data)
svr4_32_term_ioctl(fp, l, retval, fd, cmd, data)
struct file *fp;
struct proc *p;
struct lwp *l;
register_t *retval;
int fd;
u_long cmd;
caddr_t data;
{
struct proc *p = l->l_proc;
struct termios bt;
struct svr4_32_termios st;
struct svr4_termio t;
@ -622,6 +624,6 @@ svr4_32_term_ioctl(fp, p, retval, fd, cmd, data)
}
default:
return svr4_32_stream_ti_ioctl(fp, p, retval, fd, cmd, data);
return svr4_32_stream_ti_ioctl(fp, l, retval, fd, cmd, data);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_32_ucontext.h,v 1.1 2001/02/06 16:38:00 eeh Exp $ */
/* $NetBSD: svr4_32_ucontext.h,v 1.2 2003/01/19 16:47:17 thorpej Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -72,12 +72,12 @@ struct svr4_32_sigframe {
};
void *svr4_32_getmcontext __P((struct proc *, struct svr4_32_mcontext *,
void *svr4_32_getmcontext __P((struct lwp *, struct svr4_32_mcontext *,
netbsd32_u_long *));
int svr4_32_setmcontext __P((struct proc *, struct svr4_32_mcontext *,
int svr4_32_setmcontext __P((struct lwp *, struct svr4_32_mcontext *,
netbsd32_u_long));
void svr4_32_getcontext __P((struct proc *, struct svr4_32_ucontext *, sigset_t *));
int svr4_32_setcontext __P((struct proc *, struct svr4_32_ucontext *));
void svr4_32_getcontext __P((struct lwp *, struct svr4_32_ucontext *, sigset_t *));
int svr4_32_setcontext __P((struct lwp *, struct svr4_32_ucontext *));
#endif /* !_SVR4_32_UCONTEXT_H_ */

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.5 2001/08/15 05:18:12 eeh Exp $
$NetBSD: syscalls.master,v 1.6 2003/01/19 16:47:17 thorpej Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@ -41,6 +41,7 @@
#include <sys/signal.h>
#include <sys/mount.h>
#include <sys/poll.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/svr4_32/svr4_32_types.h>