summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/Makefile9
-rw-r--r--sys/compat/svr4/svr4_exec.h2
-rw-r--r--sys/compat/svr4/svr4_fcntl.c133
-rw-r--r--sys/compat/svr4/svr4_filio.c36
-rw-r--r--sys/compat/svr4/svr4_ioctl.c12
-rw-r--r--sys/compat/svr4/svr4_ioctl.h12
-rw-r--r--sys/compat/svr4/svr4_misc.c297
-rw-r--r--sys/compat/svr4/svr4_proto.h158
-rw-r--r--sys/compat/svr4/svr4_resource.c28
-rw-r--r--sys/compat/svr4/svr4_signal.c116
-rw-r--r--sys/compat/svr4/svr4_socket.c24
-rw-r--r--sys/compat/svr4/svr4_socket.h5
-rw-r--r--sys/compat/svr4/svr4_sockio.c8
-rw-r--r--sys/compat/svr4/svr4_stat.c140
-rw-r--r--sys/compat/svr4/svr4_stream.c284
-rw-r--r--sys/compat/svr4/svr4_syscall.h2
-rw-r--r--sys/compat/svr4/svr4_syscallnames.c2
-rw-r--r--sys/compat/svr4/svr4_sysent.c2
-rw-r--r--sys/compat/svr4/svr4_sysvec.c15
-rw-r--r--sys/compat/svr4/svr4_termios.c16
-rw-r--r--sys/compat/svr4/svr4_ttold.c28
-rw-r--r--sys/compat/svr4/svr4_util.h4
22 files changed, 670 insertions, 663 deletions
diff --git a/sys/compat/svr4/Makefile b/sys/compat/svr4/Makefile
index 00f8264..6de19bc 100644
--- a/sys/compat/svr4/Makefile
+++ b/sys/compat/svr4/Makefile
@@ -5,14 +5,15 @@
MAINTAINER= newton@freebsd.org
all:
- @echo "make sysent only"
+ @echo "make syscallnames only"
-syscallnames: svr4_sysent.c svr4_syscall.h svr4_proto.h
+sysent: svr4_sysent.c svr4_syscall.h svr4_proto.h
svr4_syscallnames.c svr4_sysent.c svr4_syscall.h svr4_proto.h: \
- ../kern/makesyscalls.sh syscalls.master syscalls.conf
+ ../../kern/makesyscalls.sh syscalls.master syscalls.conf
-mv -f svr4_syscallnames.c svr4_syscallnames.c.bak
-mv -f svr4_sysent.c svr4_sysent.c.bak
-mv -f svr4_syscall.h svr4_syscall.h.bak
-mv -f svr4_proto.h svr4_proto.h.bak
- sh ../kern/makesyscalls.sh syscalls.master syscalls.conf
+ sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf
+
diff --git a/sys/compat/svr4/svr4_exec.h b/sys/compat/svr4/svr4_exec.h
index 716dad1..f15211b 100644
--- a/sys/compat/svr4/svr4_exec.h
+++ b/sys/compat/svr4/svr4_exec.h
@@ -65,6 +65,6 @@
#endif
#endif
-/*void svr4_setregs __P((struct proc *, struct exec_package *, u_long));*/
+/*void svr4_setregs __P((struct thread *, struct exec_package *, u_long));*/
#endif /* !_SVR4_EXEC_H_ */
diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c
index afa62b7..465bae5 100644
--- a/sys/compat/svr4/svr4_fcntl.c
+++ b/sys/compat/svr4/svr4_fcntl.c
@@ -55,8 +55,8 @@
static int svr4_to_bsd_flags __P((int));
static u_long svr4_to_bsd_cmd __P((u_long));
-static int fd_revoke __P((struct proc *, int));
-static int fd_truncate __P((struct proc *, int, struct flock *));
+static int fd_revoke __P((struct thread *, int));
+static int fd_truncate __P((struct thread *, int, struct flock *));
static int bsd_to_svr4_flags __P((int));
static void bsd_to_svr4_flock __P((struct flock *, struct svr4_flock *));
static void svr4_to_bsd_flock __P((struct svr4_flock *, struct flock *));
@@ -242,18 +242,18 @@ svr4_to_bsd_flock64(iflp, oflp)
static int
-fd_revoke(p, fd)
- struct proc *p;
+fd_revoke(td, fd)
+ struct thread *td;
int fd;
{
- struct filedesc *fdp = p->p_fd;
+ struct filedesc *fdp = td->td_proc->p_fd;
struct file *fp;
struct vnode *vp;
struct mount *mp;
struct vattr vattr;
int error, *retval;
- retval = p->p_retval;
+ retval = td->td_retval;
if ((u_int)fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL)
return EBADF;
@@ -267,11 +267,11 @@ fd_revoke(p, fd)
goto out;
}
- if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
+ if ((error = VOP_GETATTR(vp, &vattr, td->td_proc->p_ucred, td)) != 0)
goto out;
- if (p->p_ucred->cr_uid != vattr.va_uid &&
- (error = suser(p)) != 0)
+ if (td->td_proc->p_ucred->cr_uid != vattr.va_uid &&
+ (error = suser_td(td)) != 0)
goto out;
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
@@ -286,12 +286,12 @@ out:
static int
-fd_truncate(p, fd, flp)
- struct proc *p;
+fd_truncate(td, fd, flp)
+ struct thread *td;
int fd;
struct flock *flp;
{
- struct filedesc *fdp = p->p_fd;
+ struct filedesc *fdp = td->td_proc->p_fd;
struct file *fp;
off_t start, length;
struct vnode *vp;
@@ -299,7 +299,7 @@ fd_truncate(p, fd, flp)
int error, *retval;
struct ftruncate_args ft;
- retval = p->p_retval;
+ retval = td->td_retval;
/*
* We only support truncating the file.
@@ -311,7 +311,7 @@ fd_truncate(p, fd, flp)
if (fp->f_type != DTYPE_VNODE || vp->v_type == VFIFO)
return ESPIPE;
- if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
+ if ((error = VOP_GETATTR(vp, &vattr, td->td_proc->p_ucred, td)) != 0)
return error;
length = vattr.va_size;
@@ -341,24 +341,25 @@ fd_truncate(p, fd, flp)
SCARG(&ft, fd) = fd;
SCARG(&ft, length) = start;
- return ftruncate(p, &ft);
+ return ftruncate(td, &ft);
}
int
-svr4_sys_open(p, uap)
- register struct proc *p;
+svr4_sys_open(td, uap)
+ register struct thread *td;
struct svr4_sys_open_args *uap;
{
+ struct proc *p = td->td_proc;
int error, retval;
struct open_args cup;
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
(&cup)->path = uap->path;
(&cup)->flags = svr4_to_bsd_flags(uap->flags);
(&cup)->mode = uap->mode;
- error = open(p, &cup);
+ error = open(td, &cup);
if (error) {
/* uprintf("svr4_open(%s, 0x%0x, 0%o): %d\n", uap->path,
@@ -366,19 +367,19 @@ svr4_sys_open(p, uap)
return error;
}
- retval = p->p_retval[0];
+ retval = td->td_retval[0];
PROC_LOCK(p);
if (!(SCARG(&cup, flags) & O_NOCTTY) && SESS_LEADER(p) &&
- !(p->p_flag & P_CONTROLT)) {
+ !(td->td_proc->p_flag & P_CONTROLT)) {
#if defined(NOTYET)
- struct filedesc *fdp = p->p_fd;
+ struct filedesc *fdp = td->td_proc->p_fd;
struct file *fp = fdp->fd_ofiles[retval];
PROC_UNLOCK(p);
/* ignore any error, just give it a try */
if (fp->f_type == DTYPE_VNODE)
- fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, p);
+ fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td);
} else
PROC_UNLOCK(p);
#else
@@ -389,41 +390,41 @@ svr4_sys_open(p, uap)
}
int
-svr4_sys_open64(p, uap)
- register struct proc *p;
+svr4_sys_open64(td, uap)
+ register struct thread *td;
struct svr4_sys_open64_args *uap;
{
- return svr4_sys_open(p, (struct svr4_sys_open_args *)uap);
+ return svr4_sys_open(td, (struct svr4_sys_open_args *)uap);
}
int
-svr4_sys_creat(p, uap)
- register struct proc *p;
+svr4_sys_creat(td, uap)
+ register struct thread *td;
struct svr4_sys_creat_args *uap;
{
struct open_args cup;
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, mode) = SCARG(uap, mode);
SCARG(&cup, flags) = O_WRONLY | O_CREAT | O_TRUNC;
- return open(p, &cup);
+ return open(td, &cup);
}
int
-svr4_sys_creat64(p, uap)
- register struct proc *p;
+svr4_sys_creat64(td, uap)
+ register struct thread *td;
struct svr4_sys_creat64_args *uap;
{
- return svr4_sys_creat(p, (struct svr4_sys_creat_args *)uap);
+ return svr4_sys_creat(td, (struct svr4_sys_creat_args *)uap);
}
int
-svr4_sys_llseek(p, uap)
- register struct proc *p;
+svr4_sys_llseek(td, uap)
+ register struct thread *td;
struct svr4_sys_llseek_args *uap;
{
struct lseek_args ap;
@@ -439,32 +440,32 @@ svr4_sys_llseek(p, uap)
#endif
SCARG(&ap, whence) = SCARG(uap, whence);
- return lseek(p, &ap);
+ return lseek(td, &ap);
}
int
-svr4_sys_access(p, uap)
- register struct proc *p;
+svr4_sys_access(td, uap)
+ register struct thread *td;
struct svr4_sys_access_args *uap;
{
struct access_args cup;
int *retval;
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
- retval = p->p_retval;
+ retval = td->td_retval;
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, flags) = SCARG(uap, flags);
- return access(p, &cup);
+ return access(td, &cup);
}
#if defined(NOTYET)
int
-svr4_sys_pread(p, uap)
- register struct proc *p;
+svr4_sys_pread(td, uap)
+ register struct thread *td;
struct svr4_sys_pread_args *uap;
{
struct pread_args pra;
@@ -478,14 +479,14 @@ svr4_sys_pread(p, uap)
SCARG(&pra, nbyte) = SCARG(uap, nbyte);
SCARG(&pra, offset) = SCARG(uap, off);
- return pread(p, &pra);
+ return pread(td, &pra);
}
#endif
#if defined(NOTYET)
int
-svr4_sys_pread64(p, v, retval)
- register struct proc *p;
+svr4_sys_pread64(td, v, retval)
+ register struct thread *td;
void *v;
register_t *retval;
{
@@ -502,14 +503,14 @@ svr4_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(td, &pra, retval));
}
#endif /* NOTYET */
#if defined(NOTYET)
int
-svr4_sys_pwrite(p, uap)
- register struct proc *p;
+svr4_sys_pwrite(td, uap)
+ register struct thread *td;
struct svr4_sys_pwrite_args *uap;
{
struct pwrite_args pwa;
@@ -523,14 +524,14 @@ svr4_sys_pwrite(p, uap)
SCARG(&pwa, nbyte) = SCARG(uap, nbyte);
SCARG(&pwa, offset) = SCARG(uap, off);
- return pwrite(p, &pwa);
+ return pwrite(td, &pwa);
}
#endif
#if defined(NOTYET)
int
-svr4_sys_pwrite64(p, v, retval)
- register struct proc *p;
+svr4_sys_pwrite64(td, v, retval)
+ register struct thread *td;
void *v;
register_t *retval;
{
@@ -546,20 +547,20 @@ svr4_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(td, &pwa, retval));
}
#endif /* NOTYET */
int
-svr4_sys_fcntl(p, uap)
- register struct proc *p;
+svr4_sys_fcntl(td, uap)
+ register struct thread *td;
struct svr4_sys_fcntl_args *uap;
{
int error;
struct fcntl_args fa;
int *retval;
- retval = p->p_retval;
+ retval = td->td_retval;
SCARG(&fa, fd) = SCARG(uap, fd);
SCARG(&fa, cmd) = svr4_to_bsd_cmd(SCARG(uap, cmd));
@@ -569,11 +570,11 @@ svr4_sys_fcntl(p, uap)
case F_GETFD:
case F_SETFD:
SCARG(&fa, arg) = (long) SCARG(uap, arg);
- return fcntl(p, &fa);
+ return fcntl(td, &fa);
case F_GETFL:
SCARG(&fa, arg) = (long) SCARG(uap, arg);
- error = fcntl(p, &fa);
+ error = fcntl(td, &fa);
if (error)
return error;
*retval = bsd_to_svr4_flags(*retval);
@@ -592,14 +593,14 @@ svr4_sys_fcntl(p, uap)
cmd = SCARG(&fa, cmd); /* save it for a while */
SCARG(&fa, cmd) = F_GETFL;
- if ((error = fcntl(p, &fa)) != 0)
+ if ((error = fcntl(td, &fa)) != 0)
return error;
flags = *retval;
flags &= O_ASYNC;
flags |= svr4_to_bsd_flags((u_long) SCARG(uap, arg));
SCARG(&fa, cmd) = cmd;
SCARG(&fa, arg) = (long) flags;
- return fcntl(p, &fa);
+ return fcntl(td, &fa);
}
case F_GETLK:
@@ -623,7 +624,7 @@ svr4_sys_fcntl(p, uap)
if (error)
return error;
- error = fcntl(p, &fa);
+ error = fcntl(td, &fa);
if (error || SCARG(&fa, cmd) != F_GETLK)
return error;
@@ -643,7 +644,7 @@ svr4_sys_fcntl(p, uap)
SCARG(&du, from) = SCARG(uap, fd);
SCARG(&du, to) = (int)SCARG(uap, arg);
- error = dup2(p, &du);
+ error = dup2(td, &du);
if (error)
return error;
*retval = SCARG(&du, to);
@@ -660,7 +661,7 @@ svr4_sys_fcntl(p, uap)
if (error)
return error;
svr4_to_bsd_flock(&ifl, &fl);
- return fd_truncate(p, SCARG(uap, fd), &fl);
+ return fd_truncate(td, SCARG(uap, fd), &fl);
}
case SVR4_F_GETLK64:
@@ -685,7 +686,7 @@ svr4_sys_fcntl(p, uap)
if (error)
return error;
- error = fcntl(p, &fa);
+ error = fcntl(td, &fa);
if (error || SCARG(&fa, cmd) != F_GETLK)
return error;
@@ -709,11 +710,11 @@ svr4_sys_fcntl(p, uap)
if (error)
return error;
svr4_to_bsd_flock64(&ifl, &fl);
- return fd_truncate(p, SCARG(uap, fd), &fl);
+ return fd_truncate(td, SCARG(uap, fd), &fl);
}
case SVR4_F_REVOKE:
- return fd_revoke(p, SCARG(uap, fd));
+ return fd_revoke(td, SCARG(uap, fd));
default:
return ENOSYS;
diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c
index c467dad..8d24788 100644
--- a/sys/compat/svr4/svr4_filio.c
+++ b/sys/compat/svr4/svr4_filio.c
@@ -51,8 +51,8 @@
/*#define GROTTY_READ_HACK*/
int
-svr4_sys_poll(p, uap)
- struct proc *p;
+svr4_sys_poll(td, uap)
+ struct thread *td;
struct svr4_sys_poll_args *uap;
{
int error;
@@ -68,7 +68,7 @@ svr4_sys_poll(p, uap)
siz = SCARG(uap, nfds) * sizeof(struct pollfd);
pfd = (struct pollfd *)malloc(siz, M_TEMP, M_WAITOK);
- error = poll(p, (struct poll_args *)uap);
+ error = poll(td, (struct poll_args *)uap);
if ((cerr = copyin(SCARG(uap, fds), pfd, siz)) != 0) {
error = cerr;
@@ -92,12 +92,12 @@ done:
#if defined(READ_TEST)
int
-svr4_sys_read(p, uap)
- struct proc *p;
+svr4_sys_read(td, uap)
+ struct thread *td;
struct svr4_sys_read_args *uap;
{
struct read_args ra;
- struct filedesc *fdp = p->p_fd;
+ struct filedesc *fdp = td->td_proc->p_fd;
struct file *fp;
struct socket *so = NULL;
int so_state;
@@ -126,15 +126,15 @@ svr4_sys_read(p, uap)
#endif
}
- rv = read(p, &ra);
+ rv = read(td, &ra);
DPRINTF(("svr4_read(%d, 0x%0x, %d) = %d\n",
SCARG(uap, fd), SCARG(uap, buf), SCARG(uap, nbyte), rv));
if (rv == EAGAIN) {
- DPRINTF(("sigmask = 0x%x\n", p->p_sigmask));
- DPRINTF(("sigignore = 0x%x\n", p->p_sigignore));
- DPRINTF(("sigcaught = 0x%x\n", p->p_sigcatch));
- DPRINTF(("siglist = 0x%x\n", p->p_siglist));
+ DPRINTF(("sigmask = 0x%x\n", td->td_proc->p_sigmask));
+ DPRINTF(("sigignore = 0x%x\n", td->td_proc->p_sigignore));
+ DPRINTF(("sigcaught = 0x%x\n", td->td_proc->p_sigcatch));
+ DPRINTF(("siglist = 0x%x\n", td->td_proc->p_siglist));
}
#if defined(GROTTY_READ_HACK)
@@ -149,8 +149,8 @@ svr4_sys_read(p, uap)
#if defined(BOGUS)
int
-svr4_sys_write(p, uap)
- struct proc *p;
+svr4_sys_write(td, uap)
+ struct thread *td;
struct svr4_sys_write_args *uap;
{
struct write_args wa;
@@ -162,7 +162,7 @@ svr4_sys_write(p, uap)
SCARG(&wa, buf) = SCARG(uap, buf);
SCARG(&wa, nbyte) = SCARG(uap, nbyte);
- rv = write(p, &wa);
+ rv = write(td, &wa);
DPRINTF(("svr4_write(%d, 0x%0x, %d) = %d\n",
SCARG(uap, fd), SCARG(uap, buf), SCARG(uap, nbyte), rv));
@@ -172,9 +172,9 @@ svr4_sys_write(p, uap)
#endif /* BOGUS */
int
-svr4_fil_ioctl(fp, p, retval, fd, cmd, data)
+svr4_fil_ioctl(fp, td, retval, fd, cmd, data)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -182,7 +182,7 @@ svr4_fil_ioctl(fp, p, retval, fd, cmd, data)
{
int error;
int num;
- struct filedesc *fdp = p->p_fd;
+ struct filedesc *fdp = td->td_proc->p_fd;
*retval = 0;
@@ -214,7 +214,7 @@ svr4_fil_ioctl(fp, p, retval, fd, cmd, data)
#ifdef SVR4_DEBUG
if (cmd == FIOASYNC) DPRINTF(("FIOASYNC\n"));
#endif
- error = fo_ioctl(fp, cmd, (caddr_t) &num, p);
+ error = fo_ioctl(fp, cmd, (caddr_t) &num, td);
if (error)
return error;
diff --git a/sys/compat/svr4/svr4_ioctl.c b/sys/compat/svr4/svr4_ioctl.c
index d93e2b8..e153713 100644
--- a/sys/compat/svr4/svr4_ioctl.c
+++ b/sys/compat/svr4/svr4_ioctl.c
@@ -78,15 +78,15 @@ svr4_decode_cmd(cmd, dir, c, num, argsiz)
#endif
int
-svr4_sys_ioctl(p, uap)
- register struct proc *p;
+svr4_sys_ioctl(td, uap)
+ register struct thread *td;
struct svr4_sys_ioctl_args *uap;
{
int *retval;
struct file *fp;
struct filedesc *fdp;
u_long cmd;
- int (*fun) __P((struct file *, struct proc *, register_t *,
+ int (*fun) __P((struct file *, struct thread *, register_t *,
int, u_long, caddr_t));
#ifdef DEBUG_SVR4
char dir[4];
@@ -99,8 +99,8 @@ svr4_sys_ioctl(p, uap)
DPRINTF(("svr4_ioctl[%lx](%d, _IO%s(%c, %d, %d), %p);\n", SCARG(uap, com), SCARG(uap, fd),
dir, c, num, argsiz, SCARG(uap, data)));
#endif
- retval = p->p_retval;
- fdp = p->p_fd;
+ retval = td->td_retval;
+ fdp = td->td_proc->p_fd;
cmd = SCARG(uap, com);
if ((u_int)SCARG(uap, fd) >= fdp->fd_nfiles ||
@@ -157,5 +157,5 @@ svr4_sys_ioctl(p, uap)
DPRINTF((">>> OUT: so_state = 0x%x\n", so->so_state));
}
#endif
- return (*fun)(fp, p, retval, SCARG(uap, fd), cmd, SCARG(uap, data));
+ return (*fun)(fp, td, retval, SCARG(uap, fd), cmd, SCARG(uap, data));
}
diff --git a/sys/compat/svr4/svr4_ioctl.h b/sys/compat/svr4/svr4_ioctl.h
index a5c6a53..2d7e136 100644
--- a/sys/compat/svr4/svr4_ioctl.h
+++ b/sys/compat/svr4/svr4_ioctl.h
@@ -46,17 +46,17 @@
#define SVR4_IOW(g,n,t) SVR4_IOC(SVR4_IOC_IN, (g), (n), sizeof(t))
#define SVR4_IOWR(g,n,t) SVR4_IOC(SVR4_IOC_INOUT,(g), (n), sizeof(t))
-int svr4_stream_ti_ioctl __P((struct file *, struct proc *, register_t *,
+int svr4_stream_ti_ioctl __P((struct file *, struct thread *, register_t *,
int, u_long, caddr_t));
-int svr4_stream_ioctl __P((struct file *, struct proc *, register_t *,
+int svr4_stream_ioctl __P((struct file *, struct thread *, register_t *,
int, u_long, caddr_t));
-int svr4_term_ioctl __P((struct file *, struct proc *, register_t *,
+int svr4_term_ioctl __P((struct file *, struct thread *, register_t *,
int, u_long, caddr_t));
-int svr4_ttold_ioctl __P((struct file *, struct proc *, register_t *,
+int svr4_ttold_ioctl __P((struct file *, struct thread *, register_t *,
int, u_long, caddr_t));
-int svr4_fil_ioctl __P((struct file *, struct proc *, register_t *,
+int svr4_fil_ioctl __P((struct file *, struct thread *, register_t *,
int, u_long, caddr_t));
-int svr4_sock_ioctl __P((struct file *, struct proc *, register_t *,
+int svr4_sock_ioctl __P((struct file *, struct thread *, register_t *,
int, u_long, caddr_t));
#endif /* !_SVR4_IOCTL_H_ */
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index 6865880..fd6c472 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -95,14 +95,14 @@
#define BSD_DIRENT(cp) ((struct dirent *)(cp))
-static int svr4_mknod __P((struct proc *, register_t *, char *,
+static int svr4_mknod __P((struct thread *, register_t *, char *,
svr4_mode_t, svr4_dev_t));
static __inline clock_t timeval_to_clock_t __P((struct timeval *));
static int svr4_setinfo __P((struct proc *, int, svr4_siginfo_t *));
struct svr4_hrtcntl_args;
-static int svr4_hrtcntl __P((struct proc *, struct svr4_hrtcntl_args *,
+static int svr4_hrtcntl __P((struct thread *, struct svr4_hrtcntl_args *,
register_t *));
static void bsd_statfs_to_svr4_statvfs __P((const struct statfs *,
struct svr4_statvfs *));
@@ -113,22 +113,22 @@ static struct proc *svr4_pfind __P((pid_t pid));
/* BOGUS noop */
#if defined(BOGUS)
int
-svr4_sys_setitimer(p, uap)
- register struct proc *p;
+svr4_sys_setitimer(td, uap)
+ register struct thread *td;
struct svr4_sys_setitimer_args *uap;
{
- p->p_retval[0] = 0;
+ td->td_retval[0] = 0;
return 0;
}
#endif
int
-svr4_sys_wait(p, uap)
- struct proc *p;
+svr4_sys_wait(td, uap)
+ struct thread *td;
struct svr4_sys_wait_args *uap;
{
struct wait_args w4;
- int error, *retval = p->p_retval, st, sig;
+ int error, *retval = td->td_retval, st, sig;
size_t sz = sizeof(*SCARG(&w4, status));
SCARG(&w4, rusage) = NULL;
@@ -144,7 +144,7 @@ svr4_sys_wait(p, uap)
SCARG(&w4, pid) = WAIT_ANY;
- if ((error = wait4(p, &w4)) != 0)
+ if ((error = wait4(td, &w4)) != 0)
return error;
if ((error = copyin(SCARG(&w4, status), &st, sizeof(st))) != 0)
@@ -174,44 +174,44 @@ svr4_sys_wait(p, uap)
}
int
-svr4_sys_execv(p, uap)
- struct proc *p;
+svr4_sys_execv(td, uap)
+ struct thread *td;
struct svr4_sys_execv_args *uap;
{
struct execve_args ap;
caddr_t sg;
sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&ap, fname) = SCARG(uap, path);
SCARG(&ap, argv) = SCARG(uap, argp);
SCARG(&ap, envv) = NULL;
- return execve(p, &ap);
+ return execve(td, &ap);
}
int
-svr4_sys_execve(p, uap)
- struct proc *p;
+svr4_sys_execve(td, uap)
+ struct thread *td;
struct svr4_sys_execve_args *uap;
{
struct execve_args ap;
caddr_t sg;
sg = stackgap_init();
- CHECKALTEXIST(p, &sg, uap->path);
+ CHECKALTEXIST(td, &sg, uap->path);
SCARG(&ap, fname) = SCARG(uap, path);
SCARG(&ap, argv) = SCARG(uap, argp);
SCARG(&ap, envv) = SCARG(uap, envp);
- return execve(p, &ap);
+ return execve(td, &ap);
}
int
-svr4_sys_time(p, v)
- struct proc *p;
+svr4_sys_time(td, v)
+ struct thread *td;
struct svr4_sys_time_args *v;
{
struct svr4_sys_time_args *uap = v;
@@ -222,7 +222,7 @@ svr4_sys_time(p, v)
if (SCARG(uap, t))
error = copyout(&tv.tv_sec, SCARG(uap, t),
sizeof(*(SCARG(uap, t))));
- p->p_retval[0] = (int) tv.tv_sec;
+ td->td_retval[0] = (int) tv.tv_sec;
return error;
}
@@ -237,8 +237,8 @@ svr4_sys_time(p, v)
* to adapt the NetBSD version.
*/
int
-svr4_sys_getdents64(p, uap)
- struct proc *p;
+svr4_sys_getdents64(td, uap)
+ struct thread *td;
struct svr4_sys_getdents64_args *uap;
{
register struct dirent *bdp;
@@ -258,8 +258,8 @@ svr4_sys_getdents64(p, uap)
int ncookies;
DPRINTF(("svr4_sys_getdents64(%d, *, %d)\n",
- p->p_pid, SCARG(uap, fd), SCARG(uap, nbytes)));
- if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) {
+ td->td_proc->p_pid, SCARG(uap, fd), SCARG(uap, nbytes)));
+ if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) {
return (error);
}
@@ -271,7 +271,7 @@ svr4_sys_getdents64(p, uap)
if (vp->v_type != VDIR)
return (EINVAL);
- if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p))) {
+ if ((error = VOP_GETATTR(vp, &va, td->td_proc->p_ucred, td))) {
return error;
}
@@ -288,7 +288,7 @@ svr4_sys_getdents64(p, uap)
buflen = max(DIRBLKSIZ, nbytes);
buflen = min(buflen, MAXBSIZE);
buf = malloc(buflen, M_TEMP, M_WAITOK);
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
again:
aiov.iov_base = buf;
aiov.iov_len = buflen;
@@ -296,7 +296,7 @@ again:
auio.uio_iovcnt = 1;
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_procp = p;
+ auio.uio_td = td;
auio.uio_resid = buflen;
auio.uio_offset = off;
@@ -398,19 +398,19 @@ again:
nbytes = resid + svr4reclen;
eof:
- p->p_retval[0] = nbytes - resid;
+ td->td_retval[0] = nbytes - resid;
out:
if (cookies)
free(cookies, M_TEMP);
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
free(buf, M_TEMP);
return error;
}
int
-svr4_sys_getdents(p, uap)
- struct proc *p;
+svr4_sys_getdents(td, uap)
+ struct thread *td;
struct svr4_sys_getdents_args *uap;
{
struct dirent *bdp;
@@ -426,9 +426,9 @@ svr4_sys_getdents(p, uap)
off_t off; /* true file offset */
int buflen, error, eofflag;
u_long *cookiebuf = NULL, *cookie;
- int ncookies = 0, *retval = p->p_retval;
+ int ncookies = 0, *retval = td->td_retval;
- if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
+ if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
if ((fp->f_flag & FREAD) == 0)
@@ -440,7 +440,7 @@ svr4_sys_getdents(p, uap)
buflen = min(MAXBSIZE, SCARG(uap, nbytes));
buf = malloc(buflen, M_TEMP, M_WAITOK);
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
off = fp->f_offset;
again:
aiov.iov_base = buf;
@@ -449,7 +449,7 @@ again:
auio.uio_iovcnt = 1;
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_procp = p;
+ auio.uio_td = td;
auio.uio_resid = buflen;
auio.uio_offset = off;
/*
@@ -514,7 +514,7 @@ again:
eof:
*retval = SCARG(uap, nbytes) - resid;
out:
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
if (cookiebuf)
free(cookiebuf, M_TEMP);
free(buf, M_TEMP);
@@ -523,14 +523,14 @@ out:
int
-svr4_sys_mmap(p, uap)
- struct proc *p;
+svr4_sys_mmap(td, uap)
+ struct thread *td;
struct svr4_sys_mmap_args *uap;
{
struct mmap_args mm;
int *retval;
- retval = p->p_retval;
+ retval = td->td_retval;
#define _MAP_NEW 0x80000000
/*
* Verify the arguments.
@@ -548,12 +548,12 @@ svr4_sys_mmap(p, uap)
SCARG(&mm, addr) = SCARG(uap, addr);
SCARG(&mm, pos) = SCARG(uap, pos);
- return mmap(p, &mm);
+ return mmap(td, &mm);
}
int
-svr4_sys_mmap64(p, uap)
- struct proc *p;
+svr4_sys_mmap64(td, uap)
+ struct thread *td;
struct svr4_sys_mmap64_args *uap;
{
struct mmap_args mm;
@@ -576,36 +576,36 @@ svr4_sys_mmap64(p, uap)
SCARG(&mm, addr) = SCARG(uap, addr);
SCARG(&mm, pos) = SCARG(uap, pos);
- rp = (void *) round_page((vm_offset_t)(p->p_vmspace->vm_daddr + MAXDSIZ));
+ rp = (void *) round_page((vm_offset_t)(td->td_proc->p_vmspace->vm_daddr + MAXDSIZ));
if ((SCARG(&mm, flags) & MAP_FIXED) == 0 &&
SCARG(&mm, addr) != 0 && (void *)SCARG(&mm, addr) < rp)
SCARG(&mm, addr) = rp;
- return mmap(p, &mm);
+ return mmap(td, &mm);
}
int
-svr4_sys_fchroot(p, uap)
- struct proc *p;
+svr4_sys_fchroot(td, uap)
+ struct thread *td;
struct svr4_sys_fchroot_args *uap;
{
- struct filedesc *fdp = p->p_fd;
+ struct filedesc *fdp = td->td_proc->p_fd;
struct vnode *vp;
struct file *fp;
int error;
- if ((error = suser(p)) != 0)
+ if ((error = suser_td(td)) != 0)
return error;
if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0)
return error;
vp = (struct vnode *) fp->f_data;
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
if (vp->v_type != VDIR)
error = ENOTDIR;
else
- error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p);
- VOP_UNLOCK(vp, 0, p);
+ error = VOP_ACCESS(vp, VEXEC, td->td_proc->p_ucred, td);
+ VOP_UNLOCK(vp, 0, td);
if (error)
return error;
VREF(vp);
@@ -617,8 +617,8 @@ svr4_sys_fchroot(p, uap)
static int
-svr4_mknod(p, retval, path, mode, dev)
- struct proc *p;
+svr4_mknod(td, retval, path, mode, dev)
+ struct thread *td;
register_t *retval;
char *path;
svr4_mode_t mode;
@@ -626,50 +626,50 @@ svr4_mknod(p, retval, path, mode, dev)
{
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, path);
+ CHECKALTEXIST(td, &sg, path);
if (S_ISFIFO(mode)) {
struct mkfifo_args ap;
SCARG(&ap, path) = path;
SCARG(&ap, mode) = mode;
- return mkfifo(p, &ap);
+ return mkfifo(td, &ap);
} else {
struct mknod_args ap;
SCARG(&ap, path) = path;
SCARG(&ap, mode) = mode;
SCARG(&ap, dev) = dev;
- return mknod(p, &ap);
+ return mknod(td, &ap);
}
}
int
-svr4_sys_mknod(p, uap)
- register struct proc *p;
+svr4_sys_mknod(td, uap)
+ register struct thread *td;
struct svr4_sys_mknod_args *uap;
{
- int *retval = p->p_retval;
- return svr4_mknod(p, retval,
+ int *retval = td->td_retval;
+ return svr4_mknod(td, retval,
SCARG(uap, path), SCARG(uap, mode),
(svr4_dev_t)svr4_to_bsd_odev_t(SCARG(uap, dev)));
}
int
-svr4_sys_xmknod(p, uap)
- struct proc *p;
+svr4_sys_xmknod(td, uap)
+ struct thread *td;
struct svr4_sys_xmknod_args *uap;
{
- int *retval = p->p_retval;
- return svr4_mknod(p, retval,
+ int *retval = td->td_retval;
+ return svr4_mknod(td, retval,
SCARG(uap, path), SCARG(uap, mode),
(svr4_dev_t)svr4_to_bsd_dev_t(SCARG(uap, dev)));
}
int
-svr4_sys_vhangup(p, uap)
- struct proc *p;
+svr4_sys_vhangup(td, uap)
+ struct thread *td;
struct svr4_sys_vhangup_args *uap;
{
return 0;
@@ -677,13 +677,13 @@ svr4_sys_vhangup(p, uap)
int
-svr4_sys_sysconfig(p, uap)
- struct proc *p;
+svr4_sys_sysconfig(td, uap)
+ struct thread *td;
struct svr4_sys_sysconfig_args *uap;
{
int *retval;
- retval = &(p->p_retval[0]);
+ retval = &(td->td_retval[0]);
switch (SCARG(uap, name)) {
case SVR4_CONFIG_UNUSED:
@@ -779,11 +779,11 @@ extern int swap_pager_full;
/* ARGSUSED */
int
-svr4_sys_break(p, uap)
- struct proc *p;
+svr4_sys_break(td, uap)
+ struct thread *td;
struct svr4_sys_break_args *uap;
{
- struct vmspace *vm = p->p_vmspace;
+ struct vmspace *vm = td->td_proc->p_vmspace;
vm_offset_t new, old, base, ns;
int rv;
@@ -793,7 +793,7 @@ svr4_sys_break(p, uap)
/* For p_rlimit. */
mtx_assert(&Giant, MA_OWNED);
if (new > base) {
- if ((new - base) > (unsigned) p->p_rlimit[RLIMIT_DATA].rlim_cur) {
+ if ((new - base) > (unsigned) td->td_proc->p_rlimit[RLIMIT_DATA].rlim_cur) {
return ENOMEM;
}
if (new >= VM_MAXUSER_ADDRESS) {
@@ -842,11 +842,11 @@ timeval_to_clock_t(tv)
int
-svr4_sys_times(p, uap)
- struct proc *p;
+svr4_sys_times(td, uap)
+ struct thread *td;
struct svr4_sys_times_args *uap;
{
- int error, *retval = p->p_retval;
+ int error, *retval = td->td_retval;
struct tms tms;
struct timeval t;
struct rusage *ru;
@@ -859,7 +859,7 @@ svr4_sys_times(p, uap)
SCARG(&ga, who) = RUSAGE_SELF;
SCARG(&ga, rusage) = ru;
- error = getrusage(p, &ga);
+ error = getrusage(td, &ga);
if (error)
return error;
@@ -870,7 +870,7 @@ svr4_sys_times(p, uap)
tms.tms_stime = timeval_to_clock_t(&r.ru_stime);
SCARG(&ga, who) = RUSAGE_CHILDREN;
- error = getrusage(p, &ga);
+ error = getrusage(td, &ga);
if (error)
return error;
@@ -888,17 +888,17 @@ svr4_sys_times(p, uap)
int
-svr4_sys_ulimit(p, uap)
- struct proc *p;
+svr4_sys_ulimit(td, uap)
+ struct thread *td;
struct svr4_sys_ulimit_args *uap;
{
- int *retval = p->p_retval;
+ int *retval = td->td_retval;
switch (SCARG(uap, cmd)) {
case SVR4_GFILLIM:
/* For p_rlimit below. */
mtx_assert(&Giant, MA_OWNED);
- *retval = p->p_rlimit[RLIMIT_FSIZE].rlim_cur / 512;
+ *retval = td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur / 512;
if (*retval == -1)
*retval = 0x7fffffff;
return 0;
@@ -914,7 +914,7 @@ svr4_sys_ulimit(p, uap)
krl.rlim_cur = SCARG(uap, newlimit) * 512;
mtx_assert(&Giant, MA_OWNED);
- krl.rlim_max = p->p_rlimit[RLIMIT_FSIZE].rlim_max;
+ krl.rlim_max = td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_max;
error = copyout(&krl, url, sizeof(*url));
if (error)
@@ -923,12 +923,12 @@ svr4_sys_ulimit(p, uap)
SCARG(&srl, which) = RLIMIT_FSIZE;
SCARG(&srl, rlp) = url;
- error = setrlimit(p, &srl);
+ error = setrlimit(td, &srl);
if (error)
return error;
mtx_assert(&Giant, MA_OWNED);
- *retval = p->p_rlimit[RLIMIT_FSIZE].rlim_cur;
+ *retval = td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur;
if (*retval == -1)
*retval = 0x7fffffff;
return 0;
@@ -936,11 +936,11 @@ svr4_sys_ulimit(p, uap)
case SVR4_GMEMLIM:
{
- struct vmspace *vm = p->p_vmspace;
+ struct vmspace *vm = td->td_proc->p_vmspace;
register_t r;
mtx_assert(&Giant, MA_OWNED);
- r = p->p_rlimit[RLIMIT_DATA].rlim_cur;
+ r = td->td_proc->p_rlimit[RLIMIT_DATA].rlim_cur;
if (r == -1)
r = 0x7fffffff;
@@ -953,7 +953,7 @@ svr4_sys_ulimit(p, uap)
case SVR4_GDESLIM:
mtx_assert(&Giant, MA_OWNED);
- *retval = p->p_rlimit[RLIMIT_NOFILE].rlim_cur;
+ *retval = td->td_proc->p_rlimit[RLIMIT_NOFILE].rlim_cur;
if (*retval == -1)
*retval = 0x7fffffff;
return 0;
@@ -979,11 +979,12 @@ svr4_pfind(pid)
int
-svr4_sys_pgrpsys(p, uap)
- struct proc *p;
+svr4_sys_pgrpsys(td, uap)
+ struct thread *td;
struct svr4_sys_pgrpsys_args *uap;
{
- int *retval = p->p_retval;
+ int *retval = td->td_retval;
+ struct proc *p = td->td_proc;
switch (SCARG(uap, cmd)) {
case 1: /* setpgrp() */
@@ -994,7 +995,7 @@ svr4_sys_pgrpsys(p, uap)
* setsid() for SVR4. (Under BSD, the difference is that
* a setpgid(0,0) will not create a new session.)
*/
- setsid(p, NULL);
+ setsid(td, NULL);
/*FALLTHROUGH*/
case 0: /* getpgrp() */
@@ -1014,7 +1015,7 @@ svr4_sys_pgrpsys(p, uap)
return 0;
case 3: /* setsid() */
- return setsid(p, NULL);
+ return setsid(td, NULL);
case 4: /* getpgid(pid) */
@@ -1032,7 +1033,7 @@ svr4_sys_pgrpsys(p, uap)
SCARG(&sa, pid) = SCARG(uap, pid);
SCARG(&sa, pgid) = SCARG(uap, pgid);
- return setpgid(p, &sa);
+ return setpgid(td, &sa);
}
default:
@@ -1052,8 +1053,8 @@ struct svr4_hrtcntl_args {
static int
-svr4_hrtcntl(p, uap, retval)
- struct proc *p;
+svr4_hrtcntl(td, uap, retval)
+ struct thread *td;
struct svr4_hrtcntl_args *uap;
register_t *retval;
{
@@ -1098,15 +1099,15 @@ svr4_hrtcntl(p, uap, retval)
int
-svr4_sys_hrtsys(p, uap)
- struct proc *p;
+svr4_sys_hrtsys(td, uap)
+ struct thread *td;
struct svr4_sys_hrtsys_args *uap;
{
- int *retval = p->p_retval;
+ int *retval = td->td_retval;
switch (SCARG(uap, cmd)) {
case SVR4_HRT_CNTL:
- return svr4_hrtcntl(p, (struct svr4_hrtcntl_args *) uap,
+ return svr4_hrtcntl(td, (struct svr4_hrtcntl_args *) uap,
retval);
case SVR4_HRT_ALRM:
@@ -1187,12 +1188,12 @@ svr4_setinfo(p, st, s)
int
-svr4_sys_waitsys(p, uap)
- struct proc *p;
+svr4_sys_waitsys(td, uap)
+ struct thread *td;
struct svr4_sys_waitsys_args *uap;
{
int nfound;
- int error, *retval = p->p_retval;
+ int error, *retval = td->td_retval;
struct proc *q, *t;
@@ -1201,7 +1202,7 @@ svr4_sys_waitsys(p, uap)
break;
case SVR4_P_PGID:
- SCARG(uap, id) = -p->p_pgid;
+ SCARG(uap, id) = -td->td_proc->p_pgid;
break;
case SVR4_P_ALL:
@@ -1219,7 +1220,7 @@ svr4_sys_waitsys(p, uap)
loop:
nfound = 0;
sx_slock(&proctree_lock);
- LIST_FOREACH(q, &p->p_children, p_sibling) {
+ LIST_FOREACH(q, &td->td_proc->p_children, p_sibling) {
if (SCARG(uap, id) != WAIT_ANY &&
q->p_pid != SCARG(uap, id) &&
q->p_pgid != -SCARG(uap, id)) {
@@ -1276,7 +1277,7 @@ loop:
PROC_UNLOCK(q);
sx_xunlock(&proctree_lock);
q->p_xstat = 0;
- ruadd(&p->p_stats->p_cru, q->p_ru);
+ ruadd(&td->td_proc->p_stats->p_cru, q->p_ru);
FREE(q->p_ru, M_ZOMBIE);
q->p_ru = 0;
@@ -1320,7 +1321,7 @@ loop:
PROC_LOCK(q);
if (--q->p_procsig->ps_refcnt == 0) {
- if (q->p_sigacts != &q->p_addr->u_sigacts)
+ if (q->p_sigacts != &q->p_uarea->u_sigacts)
FREE(q->p_sigacts, M_SUBPROC);
FREE(q->p_procsig, M_SUBPROC);
q->p_procsig = NULL;
@@ -1369,7 +1370,7 @@ loop:
return 0;
}
- if ((error = tsleep((caddr_t)p, PWAIT | PCATCH, "svr4_wait", 0)) != 0)
+ if ((error = tsleep((caddr_t)td->td_proc, PWAIT | PCATCH, "svr4_wait", 0)) != 0)
return error;
goto loop;
}
@@ -1428,8 +1429,8 @@ bsd_statfs_to_svr4_statvfs64(bfs, sfs)
int
-svr4_sys_statvfs(p, uap)
- struct proc *p;
+svr4_sys_statvfs(td, uap)
+ struct thread *td;
struct svr4_sys_statvfs_args *uap;
{
struct statfs_args fs_args;
@@ -1439,11 +1440,11 @@ svr4_sys_statvfs(p, uap)
struct svr4_statvfs sfs;
int error;
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&fs_args, path) = SCARG(uap, path);
SCARG(&fs_args, buf) = fs;
- if ((error = statfs(p, &fs_args)) != 0)
+ if ((error = statfs(td, &fs_args)) != 0)
return error;
if ((error = copyin(fs, &bfs, sizeof(bfs))) != 0)
@@ -1456,8 +1457,8 @@ svr4_sys_statvfs(p, uap)
int
-svr4_sys_fstatvfs(p, uap)
- struct proc *p;
+svr4_sys_fstatvfs(td, uap)
+ struct thread *td;
struct svr4_sys_fstatvfs_args *uap;
{
struct fstatfs_args fs_args;
@@ -1470,7 +1471,7 @@ svr4_sys_fstatvfs(p, uap)
SCARG(&fs_args, fd) = SCARG(uap, fd);
SCARG(&fs_args, buf) = fs;
- if ((error = fstatfs(p, &fs_args)) != 0)
+ if ((error = fstatfs(td, &fs_args)) != 0)
return error;
if ((error = copyin(fs, &bfs, sizeof(bfs))) != 0)
@@ -1483,8 +1484,8 @@ svr4_sys_fstatvfs(p, uap)
int
-svr4_sys_statvfs64(p, uap)
- struct proc *p;
+svr4_sys_statvfs64(td, uap)
+ struct thread *td;
struct svr4_sys_statvfs64_args *uap;
{
struct statfs_args fs_args;
@@ -1494,11 +1495,11 @@ svr4_sys_statvfs64(p, uap)
struct svr4_statvfs64 sfs;
int error;
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&fs_args, path) = SCARG(uap, path);
SCARG(&fs_args, buf) = fs;
- if ((error = statfs(p, &fs_args)) != 0)
+ if ((error = statfs(td, &fs_args)) != 0)
return error;
if ((error = copyin(fs, &bfs, sizeof(bfs))) != 0)
@@ -1511,8 +1512,8 @@ svr4_sys_statvfs64(p, uap)
int
-svr4_sys_fstatvfs64(p, uap)
- struct proc *p;
+svr4_sys_fstatvfs64(td, uap)
+ struct thread *td;
struct svr4_sys_fstatvfs64_args *uap;
{
struct fstatfs_args fs_args;
@@ -1525,7 +1526,7 @@ svr4_sys_fstatvfs64(p, uap)
SCARG(&fs_args, fd) = SCARG(uap, fd);
SCARG(&fs_args, buf) = fs;
- if ((error = fstatfs(p, &fs_args)) != 0)
+ if ((error = fstatfs(td, &fs_args)) != 0)
return error;
if ((error = copyin(fs, &bfs, sizeof(bfs))) != 0)
@@ -1537,8 +1538,8 @@ svr4_sys_fstatvfs64(p, uap)
}
int
-svr4_sys_alarm(p, uap)
- struct proc *p;
+svr4_sys_alarm(td, uap)
+ struct thread *td;
struct svr4_sys_alarm_args *uap;
{
int error;
@@ -1555,19 +1556,19 @@ svr4_sys_alarm(p, uap)
SCARG(&sa, which) = ITIMER_REAL;
SCARG(&sa, itv) = itp;
SCARG(&sa, oitv) = oitp;
- error = setitimer(p, &sa);
+ error = setitimer(td, &sa);
if (error)
return error;
if (oitp->it_value.tv_usec)
oitp->it_value.tv_sec++;
- p->p_retval[0] = oitp->it_value.tv_sec;
+ td->td_retval[0] = oitp->it_value.tv_sec;
return 0;
}
int
-svr4_sys_gettimeofday(p, uap)
- struct proc *p;
+svr4_sys_gettimeofday(td, uap)
+ struct thread *td;
struct svr4_sys_gettimeofday_args *uap;
{
if (SCARG(uap, tp)) {
@@ -1581,13 +1582,13 @@ svr4_sys_gettimeofday(p, uap)
}
int
-svr4_sys_facl(p, uap)
- struct proc *p;
+svr4_sys_facl(td, uap)
+ struct thread *td;
struct svr4_sys_facl_args *uap;
{
int *retval;
- retval = p->p_retval;
+ retval = td->td_retval;
*retval = 0;
switch (SCARG(uap, cmd)) {
@@ -1609,17 +1610,17 @@ svr4_sys_facl(p, uap)
int
-svr4_sys_acl(p, uap)
- struct proc *p;
+svr4_sys_acl(td, uap)
+ struct thread *td;
struct svr4_sys_acl_args *uap;
{
/* XXX: for now the same */
- return svr4_sys_facl(p, (struct svr4_sys_facl_args *)uap);
+ return svr4_sys_facl(td, (struct svr4_sys_facl_args *)uap);
}
int
-svr4_sys_auditsys(p, uap)
- struct proc *p;
+svr4_sys_auditsys(td, uap)
+ struct thread *td;
struct svr4_sys_auditsys_args *uap;
{
/*
@@ -1629,8 +1630,8 @@ svr4_sys_auditsys(p, uap)
}
int
-svr4_sys_memcntl(p, uap)
- struct proc *p;
+svr4_sys_memcntl(td, uap)
+ struct thread *td;
struct svr4_sys_memcntl_args *uap;
{
switch (SCARG(uap, cmd)) {
@@ -1642,7 +1643,7 @@ svr4_sys_memcntl(p, uap)
SCARG(&msa, len) = SCARG(uap, len);
SCARG(&msa, flags) = (int)SCARG(uap, arg);
- return msync(p, &msa);
+ return msync(td, &msa);
}
case SVR4_MC_ADVISE:
{
@@ -1652,7 +1653,7 @@ svr4_sys_memcntl(p, uap)
SCARG(&maa, len) = SCARG(uap, len);
SCARG(&maa, behav) = (int)SCARG(uap, arg);
- return madvise(p, &maa);
+ return madvise(td, &maa);
}
case SVR4_MC_LOCK:
case SVR4_MC_UNLOCK:
@@ -1666,8 +1667,8 @@ svr4_sys_memcntl(p, uap)
int
-svr4_sys_nice(p, uap)
- struct proc *p;
+svr4_sys_nice(td, uap)
+ struct thread *td;
struct svr4_sys_nice_args *uap;
{
struct setpriority_args ap;
@@ -1677,26 +1678,26 @@ svr4_sys_nice(p, uap)
SCARG(&ap, who) = 0;
SCARG(&ap, prio) = SCARG(uap, prio);
- if ((error = setpriority(p, &ap)) != 0)
+ if ((error = setpriority(td, &ap)) != 0)
return error;
/* the cast is stupid, but the structures are the same */
- if ((error = getpriority(p, (struct getpriority_args *)&ap)) != 0)
+ if ((error = getpriority(td, (struct getpriority_args *)&ap)) != 0)
return error;
return 0;
}
int
-svr4_sys_resolvepath(p, uap)
- struct proc *p;
+svr4_sys_resolvepath(td, uap)
+ struct thread *td;
struct svr4_sys_resolvepath_args *uap;
{
struct nameidata nd;
- int error, *retval = p->p_retval;
+ int error, *retval = td->td_retval;
NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME, UIO_USERSPACE,
- SCARG(uap, path), p);
+ SCARG(uap, path), td);
if ((error = namei(&nd)) != 0)
return error;
diff --git a/sys/compat/svr4/svr4_proto.h b/sys/compat/svr4/svr4_proto.h
index 95a0ae7..d2a862f 100644
--- a/sys/compat/svr4/svr4_proto.h
+++ b/sys/compat/svr4/svr4_proto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: src/sys/svr4/syscalls.master,v 1.10 2000/07/29 10:05:24 peter Exp
+ * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.11 2000/08/31 22:54:05 obrien Exp
*/
#ifndef _SVR4_SYSPROTO_H_
@@ -15,6 +15,8 @@
struct proc;
+struct thread;
+
#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \
0 : sizeof(register_t) - sizeof(t))
@@ -381,86 +383,86 @@ struct svr4_sys_sendto_args {
struct sockaddr * to; char to_[PAD_(struct sockaddr *)];
int tolen; char tolen_[PAD_(int)];
};
-int svr4_sys_open __P((struct proc *, struct svr4_sys_open_args *));
-int svr4_sys_wait __P((struct proc *, struct svr4_sys_wait_args *));
-int svr4_sys_creat __P((struct proc *, struct svr4_sys_creat_args *));
-int svr4_sys_execv __P((struct proc *, struct svr4_sys_execv_args *));
-int svr4_sys_time __P((struct proc *, struct svr4_sys_time_args *));
-int svr4_sys_mknod __P((struct proc *, struct svr4_sys_mknod_args *));
-int svr4_sys_break __P((struct proc *, struct svr4_sys_break_args *));
-int svr4_sys_stat __P((struct proc *, struct svr4_sys_stat_args *));
-int svr4_sys_alarm __P((struct proc *, struct svr4_sys_alarm_args *));
-int svr4_sys_fstat __P((struct proc *, struct svr4_sys_fstat_args *));
-int svr4_sys_pause __P((struct proc *, struct svr4_sys_pause_args *));
-int svr4_sys_utime __P((struct proc *, struct svr4_sys_utime_args *));
-int svr4_sys_access __P((struct proc *, struct svr4_sys_access_args *));
-int svr4_sys_nice __P((struct proc *, struct svr4_sys_nice_args *));
-int svr4_sys_kill __P((struct proc *, struct svr4_sys_kill_args *));
-int svr4_sys_pgrpsys __P((struct proc *, struct svr4_sys_pgrpsys_args *));
-int svr4_sys_times __P((struct proc *, struct svr4_sys_times_args *));
-int svr4_sys_signal __P((struct proc *, struct svr4_sys_signal_args *));
+int svr4_sys_open __P((struct thread *, struct svr4_sys_open_args *));
+int svr4_sys_wait __P((struct thread *, struct svr4_sys_wait_args *));
+int svr4_sys_creat __P((struct thread *, struct svr4_sys_creat_args *));
+int svr4_sys_execv __P((struct thread *, struct svr4_sys_execv_args *));
+int svr4_sys_time __P((struct thread *, struct svr4_sys_time_args *));
+int svr4_sys_mknod __P((struct thread *, struct svr4_sys_mknod_args *));
+int svr4_sys_break __P((struct thread *, struct svr4_sys_break_args *));
+int svr4_sys_stat __P((struct thread *, struct svr4_sys_stat_args *));
+int svr4_sys_alarm __P((struct thread *, struct svr4_sys_alarm_args *));
+int svr4_sys_fstat __P((struct thread *, struct svr4_sys_fstat_args *));
+int svr4_sys_pause __P((struct thread *, struct svr4_sys_pause_args *));
+int svr4_sys_utime __P((struct thread *, struct svr4_sys_utime_args *));
+int svr4_sys_access __P((struct thread *, struct svr4_sys_access_args *));
+int svr4_sys_nice __P((struct thread *, struct svr4_sys_nice_args *));
+int svr4_sys_kill __P((struct thread *, struct svr4_sys_kill_args *));
+int svr4_sys_pgrpsys __P((struct thread *, struct svr4_sys_pgrpsys_args *));
+int svr4_sys_times __P((struct thread *, struct svr4_sys_times_args *));
+int svr4_sys_signal __P((struct thread *, struct svr4_sys_signal_args *));
#if defined(NOTYET)
-int svr4_sys_msgsys __P((struct proc *, struct svr4_sys_msgsys_args *));
+int svr4_sys_msgsys __P((struct thread *, struct svr4_sys_msgsys_args *));
#else
#endif
-int svr4_sys_sysarch __P((struct proc *, struct svr4_sys_sysarch_args *));
-int svr4_sys_ioctl __P((struct proc *, struct svr4_sys_ioctl_args *));
-int svr4_sys_utssys __P((struct proc *, struct svr4_sys_utssys_args *));
-int svr4_sys_execve __P((struct proc *, struct svr4_sys_execve_args *));
-int svr4_sys_fcntl __P((struct proc *, struct svr4_sys_fcntl_args *));
-int svr4_sys_ulimit __P((struct proc *, struct svr4_sys_ulimit_args *));
-int svr4_sys_getdents __P((struct proc *, struct svr4_sys_getdents_args *));
-int svr4_sys_getmsg __P((struct proc *, struct svr4_sys_getmsg_args *));
-int svr4_sys_putmsg __P((struct proc *, struct svr4_sys_putmsg_args *));
-int svr4_sys_poll __P((struct proc *, struct svr4_sys_poll_args *));
-int svr4_sys_lstat __P((struct proc *, struct svr4_sys_lstat_args *));
-int svr4_sys_sigprocmask __P((struct proc *, struct svr4_sys_sigprocmask_args *));
-int svr4_sys_sigsuspend __P((struct proc *, struct svr4_sys_sigsuspend_args *));
-int svr4_sys_sigaltstack __P((struct proc *, struct svr4_sys_sigaltstack_args *));
-int svr4_sys_sigaction __P((struct proc *, struct svr4_sys_sigaction_args *));
-int svr4_sys_sigpending __P((struct proc *, struct svr4_sys_sigpending_args *));
-int svr4_sys_context __P((struct proc *, struct svr4_sys_context_args *));
-int svr4_sys_statvfs __P((struct proc *, struct svr4_sys_statvfs_args *));
-int svr4_sys_fstatvfs __P((struct proc *, struct svr4_sys_fstatvfs_args *));
-int svr4_sys_waitsys __P((struct proc *, struct svr4_sys_waitsys_args *));
-int svr4_sys_hrtsys __P((struct proc *, struct svr4_sys_hrtsys_args *));
-int svr4_sys_pathconf __P((struct proc *, struct svr4_sys_pathconf_args *));
-int svr4_sys_mmap __P((struct proc *, struct svr4_sys_mmap_args *));
-int svr4_sys_fpathconf __P((struct proc *, struct svr4_sys_fpathconf_args *));
-int svr4_sys_xstat __P((struct proc *, struct svr4_sys_xstat_args *));
-int svr4_sys_lxstat __P((struct proc *, struct svr4_sys_lxstat_args *));
-int svr4_sys_fxstat __P((struct proc *, struct svr4_sys_fxstat_args *));
-int svr4_sys_xmknod __P((struct proc *, struct svr4_sys_xmknod_args *));
-int svr4_sys_setrlimit __P((struct proc *, struct svr4_sys_setrlimit_args *));
-int svr4_sys_getrlimit __P((struct proc *, struct svr4_sys_getrlimit_args *));
-int svr4_sys_memcntl __P((struct proc *, struct svr4_sys_memcntl_args *));
-int svr4_sys_uname __P((struct proc *, struct svr4_sys_uname_args *));
-int svr4_sys_sysconfig __P((struct proc *, struct svr4_sys_sysconfig_args *));
-int svr4_sys_systeminfo __P((struct proc *, struct svr4_sys_systeminfo_args *));
-int svr4_sys_fchroot __P((struct proc *, struct svr4_sys_fchroot_args *));
-int svr4_sys_utimes __P((struct proc *, struct svr4_sys_utimes_args *));
-int svr4_sys_vhangup __P((struct proc *, struct svr4_sys_vhangup_args *));
-int svr4_sys_gettimeofday __P((struct proc *, struct svr4_sys_gettimeofday_args *));
-int svr4_sys_llseek __P((struct proc *, struct svr4_sys_llseek_args *));
-int svr4_sys_acl __P((struct proc *, struct svr4_sys_acl_args *));
-int svr4_sys_auditsys __P((struct proc *, struct svr4_sys_auditsys_args *));
-int svr4_sys_facl __P((struct proc *, struct svr4_sys_facl_args *));
-int svr4_sys_resolvepath __P((struct proc *, struct svr4_sys_resolvepath_args *));
-int svr4_sys_getdents64 __P((struct proc *, struct svr4_sys_getdents64_args *));
-int svr4_sys_mmap64 __P((struct proc *, struct svr4_sys_mmap64_args *));
-int svr4_sys_stat64 __P((struct proc *, struct svr4_sys_stat64_args *));
-int svr4_sys_lstat64 __P((struct proc *, struct svr4_sys_lstat64_args *));
-int svr4_sys_fstat64 __P((struct proc *, struct svr4_sys_fstat64_args *));
-int svr4_sys_statvfs64 __P((struct proc *, struct svr4_sys_statvfs64_args *));
-int svr4_sys_fstatvfs64 __P((struct proc *, struct svr4_sys_fstatvfs64_args *));
-int svr4_sys_setrlimit64 __P((struct proc *, struct svr4_sys_setrlimit64_args *));
-int svr4_sys_getrlimit64 __P((struct proc *, struct svr4_sys_getrlimit64_args *));
-int svr4_sys_creat64 __P((struct proc *, struct svr4_sys_creat64_args *));
-int svr4_sys_open64 __P((struct proc *, struct svr4_sys_open64_args *));
-int svr4_sys_socket __P((struct proc *, struct svr4_sys_socket_args *));
-int svr4_sys_recv __P((struct proc *, struct svr4_sys_recv_args *));
-int svr4_sys_send __P((struct proc *, struct svr4_sys_send_args *));
-int svr4_sys_sendto __P((struct proc *, struct svr4_sys_sendto_args *));
+int svr4_sys_sysarch __P((struct thread *, struct svr4_sys_sysarch_args *));
+int svr4_sys_ioctl __P((struct thread *, struct svr4_sys_ioctl_args *));
+int svr4_sys_utssys __P((struct thread *, struct svr4_sys_utssys_args *));
+int svr4_sys_execve __P((struct thread *, struct svr4_sys_execve_args *));
+int svr4_sys_fcntl __P((struct thread *, struct svr4_sys_fcntl_args *));
+int svr4_sys_ulimit __P((struct thread *, struct svr4_sys_ulimit_args *));
+int svr4_sys_getdents __P((struct thread *, struct svr4_sys_getdents_args *));
+int svr4_sys_getmsg __P((struct thread *, struct svr4_sys_getmsg_args *));
+int svr4_sys_putmsg __P((struct thread *, struct svr4_sys_putmsg_args *));
+int svr4_sys_poll __P((struct thread *, struct svr4_sys_poll_args *));
+int svr4_sys_lstat __P((struct thread *, struct svr4_sys_lstat_args *));
+int svr4_sys_sigprocmask __P((struct thread *, struct svr4_sys_sigprocmask_args *));
+int svr4_sys_sigsuspend __P((struct thread *, struct svr4_sys_sigsuspend_args *));
+int svr4_sys_sigaltstack __P((struct thread *, struct svr4_sys_sigaltstack_args *));
+int svr4_sys_sigaction __P((struct thread *, struct svr4_sys_sigaction_args *));
+int svr4_sys_sigpending __P((struct thread *, struct svr4_sys_sigpending_args *));
+int svr4_sys_context __P((struct thread *, struct svr4_sys_context_args *));
+int svr4_sys_statvfs __P((struct thread *, struct svr4_sys_statvfs_args *));
+int svr4_sys_fstatvfs __P((struct thread *, struct svr4_sys_fstatvfs_args *));
+int svr4_sys_waitsys __P((struct thread *, struct svr4_sys_waitsys_args *));
+int svr4_sys_hrtsys __P((struct thread *, struct svr4_sys_hrtsys_args *));
+int svr4_sys_pathconf __P((struct thread *, struct svr4_sys_pathconf_args *));
+int svr4_sys_mmap __P((struct thread *, struct svr4_sys_mmap_args *));
+int svr4_sys_fpathconf __P((struct thread *, struct svr4_sys_fpathconf_args *));
+int svr4_sys_xstat __P((struct thread *, struct svr4_sys_xstat_args *));
+int svr4_sys_lxstat __P((struct thread *, struct svr4_sys_lxstat_args *));
+int svr4_sys_fxstat __P((struct thread *, struct svr4_sys_fxstat_args *));
+int svr4_sys_xmknod __P((struct thread *, struct svr4_sys_xmknod_args *));
+int svr4_sys_setrlimit __P((struct thread *, struct svr4_sys_setrlimit_args *));
+int svr4_sys_getrlimit __P((struct thread *, struct svr4_sys_getrlimit_args *));
+int svr4_sys_memcntl __P((struct thread *, struct svr4_sys_memcntl_args *));
+int svr4_sys_uname __P((struct thread *, struct svr4_sys_uname_args *));
+int svr4_sys_sysconfig __P((struct thread *, struct svr4_sys_sysconfig_args *));
+int svr4_sys_systeminfo __P((struct thread *, struct svr4_sys_systeminfo_args *));
+int svr4_sys_fchroot __P((struct thread *, struct svr4_sys_fchroot_args *));
+int svr4_sys_utimes __P((struct thread *, struct svr4_sys_utimes_args *));
+int svr4_sys_vhangup __P((struct thread *, struct svr4_sys_vhangup_args *));
+int svr4_sys_gettimeofday __P((struct thread *, struct svr4_sys_gettimeofday_args *));
+int svr4_sys_llseek __P((struct thread *, struct svr4_sys_llseek_args *));
+int svr4_sys_acl __P((struct thread *, struct svr4_sys_acl_args *));
+int svr4_sys_auditsys __P((struct thread *, struct svr4_sys_auditsys_args *));
+int svr4_sys_facl __P((struct thread *, struct svr4_sys_facl_args *));
+int svr4_sys_resolvepath __P((struct thread *, struct svr4_sys_resolvepath_args *));
+int svr4_sys_getdents64 __P((struct thread *, struct svr4_sys_getdents64_args *));
+int svr4_sys_mmap64 __P((struct thread *, struct svr4_sys_mmap64_args *));
+int svr4_sys_stat64 __P((struct thread *, struct svr4_sys_stat64_args *));
+int svr4_sys_lstat64 __P((struct thread *, struct svr4_sys_lstat64_args *));
+int svr4_sys_fstat64 __P((struct thread *, struct svr4_sys_fstat64_args *));
+int svr4_sys_statvfs64 __P((struct thread *, struct svr4_sys_statvfs64_args *));
+int svr4_sys_fstatvfs64 __P((struct thread *, struct svr4_sys_fstatvfs64_args *));
+int svr4_sys_setrlimit64 __P((struct thread *, struct svr4_sys_setrlimit64_args *));
+int svr4_sys_getrlimit64 __P((struct thread *, struct svr4_sys_getrlimit64_args *));
+int svr4_sys_creat64 __P((struct thread *, struct svr4_sys_creat64_args *));
+int svr4_sys_open64 __P((struct thread *, struct svr4_sys_open64_args *));
+int svr4_sys_socket __P((struct thread *, struct svr4_sys_socket_args *));
+int svr4_sys_recv __P((struct thread *, struct svr4_sys_recv_args *));
+int svr4_sys_send __P((struct thread *, struct svr4_sys_send_args *));
+int svr4_sys_sendto __P((struct thread *, struct svr4_sys_sendto_args *));
#ifdef COMPAT_43
diff --git a/sys/compat/svr4/svr4_resource.c b/sys/compat/svr4/svr4_resource.c
index 2b52140..976475d 100644
--- a/sys/compat/svr4/svr4_resource.c
+++ b/sys/compat/svr4/svr4_resource.c
@@ -128,8 +128,8 @@ svr4_to_native_rl(rl)
((svr4_rlim64_t)(l)) != SVR4_RLIM64_SAVED_MAX)
int
-svr4_sys_getrlimit(p, uap)
- register struct proc *p;
+svr4_sys_getrlimit(td, uap)
+ register struct thread *td;
struct svr4_sys_getrlimit_args *uap;
{
int rl = svr4_to_native_rl(SCARG(uap, which));
@@ -141,7 +141,7 @@ svr4_sys_getrlimit(p, uap)
/* For p_rlimit. */
mtx_assert(&Giant, MA_OWNED);
- blim = p->p_rlimit[rl];
+ blim = td->td_proc->p_rlimit[rl];
/*
* Our infinity, is their maxfiles.
@@ -175,8 +175,8 @@ svr4_sys_getrlimit(p, uap)
int
-svr4_sys_setrlimit(p, uap)
- register struct proc *p;
+svr4_sys_setrlimit(td, uap)
+ register struct thread *td;
struct svr4_sys_setrlimit_args *uap;
{
int rl = svr4_to_native_rl(SCARG(uap, which));
@@ -189,7 +189,7 @@ svr4_sys_setrlimit(p, uap)
/* For p_rlimit. */
mtx_assert(&Giant, MA_OWNED);
- limp = &p->p_rlimit[rl];
+ limp = &td->td_proc->p_rlimit[rl];
if ((error = copyin(SCARG(uap, rlp), &slim, sizeof(slim))) != 0)
return error;
@@ -221,13 +221,13 @@ svr4_sys_setrlimit(p, uap)
else if (slim.rlim_cur == SVR4_RLIM_SAVED_CUR)
blim.rlim_cur = limp->rlim_cur;
- return dosetrlimit(p, rl, &blim);
+ return dosetrlimit(td, rl, &blim);
}
int
-svr4_sys_getrlimit64(p, uap)
- register struct proc *p;
+svr4_sys_getrlimit64(td, uap)
+ register struct thread *td;
struct svr4_sys_getrlimit64_args *uap;
{
int rl = svr4_to_native_rl(SCARG(uap, which));
@@ -239,7 +239,7 @@ svr4_sys_getrlimit64(p, uap)
/* For p_rlimit. */
mtx_assert(&Giant, MA_OWNED);
- blim = p->p_rlimit[rl];
+ blim = td->td_proc->p_rlimit[rl];
/*
* Our infinity, is their maxfiles.
@@ -273,8 +273,8 @@ svr4_sys_getrlimit64(p, uap)
int
-svr4_sys_setrlimit64(p, uap)
- register struct proc *p;
+svr4_sys_setrlimit64(td, uap)
+ register struct thread *td;
struct svr4_sys_setrlimit64_args *uap;
{
int rl = svr4_to_native_rl(SCARG(uap, which));
@@ -287,7 +287,7 @@ svr4_sys_setrlimit64(p, uap)
/* For p_rlimit. */
mtx_assert(&Giant, MA_OWNED);
- limp = &p->p_rlimit[rl];
+ limp = &td->td_proc->p_rlimit[rl];
if ((error = copyin(SCARG(uap, rlp), &slim, sizeof(slim))) != 0)
return error;
@@ -319,5 +319,5 @@ svr4_sys_setrlimit64(p, uap)
else if (slim.rlim_cur == SVR4_RLIM64_SAVED_CUR)
blim.rlim_cur = limp->rlim_cur;
- return dosetrlimit(p, rl, &blim);
+ return dosetrlimit(td, rl, &blim);
}
diff --git a/sys/compat/svr4/svr4_signal.c b/sys/compat/svr4/svr4_signal.c
index 0273a7a..d4bf8e9 100644
--- a/sys/compat/svr4/svr4_signal.c
+++ b/sys/compat/svr4/svr4_signal.c
@@ -260,8 +260,8 @@ bsd_to_svr4_sigaltstack(bss, sss)
}
int
-svr4_sys_sigaction(p, uap)
- register struct proc *p;
+svr4_sys_sigaction(td, uap)
+ register struct thread *td;
struct svr4_sys_sigaction_args *uap;
{
struct svr4_sigaction *nisa, *oisa, tmpisa;
@@ -270,7 +270,7 @@ svr4_sys_sigaction(p, uap)
caddr_t sg;
int error;
- DPRINTF(("@@@ svr4_sys_sigaction(%d, %d, %d)\n", p->p_pid,
+ DPRINTF(("@@@ svr4_sys_sigaction(%d, %d, %d)\n", td->td_proc->p_pid,
SCARG(uap, signum),
SVR4_SVR42BSD_SIG(SCARG(uap, signum))));
@@ -307,7 +307,7 @@ svr4_sys_sigaction(p, uap)
SCARG(&sa, act) = nbsa;
SCARG(&sa, oact) = obsa;
- if ((error = sigaction(p, &sa)) != 0)
+ if ((error = sigaction(td, &sa)) != 0)
return error;
if (oisa != NULL) {
@@ -322,8 +322,8 @@ svr4_sys_sigaction(p, uap)
}
int
-svr4_sys_sigaltstack(p, uap)
- register struct proc *p;
+svr4_sys_sigaltstack(td, uap)
+ register struct thread *td;
struct svr4_sys_sigaltstack_args *uap;
{
struct svr4_sigaltstack *nsss, *osss, tmpsss;
@@ -332,7 +332,7 @@ svr4_sys_sigaltstack(p, uap)
caddr_t sg;
int error, *retval;
- retval = p->p_retval;
+ retval = td->td_retval;
sg = stackgap_init();
nsss = SCARG(uap, nss);
osss = SCARG(uap, oss);
@@ -355,7 +355,7 @@ svr4_sys_sigaltstack(p, uap)
SCARG(&sa, ss) = nbss;
SCARG(&sa, oss) = obss;
- if ((error = sigaltstack(p, &sa)) != 0)
+ if ((error = sigaltstack(td, &sa)) != 0)
return error;
if (obss != NULL) {
@@ -373,15 +373,15 @@ svr4_sys_sigaltstack(p, uap)
* Stolen from the ibcs2 one
*/
int
-svr4_sys_signal(p, uap)
- register struct proc *p;
+svr4_sys_signal(td, uap)
+ register struct thread *td;
struct svr4_sys_signal_args *uap;
{
int signum;
- int error, *retval = p->p_retval;
+ int error, *retval = td->td_retval;
caddr_t sg = stackgap_init();
- DPRINTF(("@@@ svr4_sys_signal(%d)\n", p->p_pid));
+ DPRINTF(("@@@ svr4_sys_signal(%d)\n", td->td_proc->p_pid));
signum = SVR4_SVR42BSD_SIG(SVR4_SIGNO(SCARG(uap, signum)));
if (signum <= 0 || signum > SVR4_NSIG)
@@ -413,7 +413,7 @@ svr4_sys_signal(p, uap)
if ((error = copyout(&sa, nbsa, sizeof(sa))) != 0)
return error;
- if ((error = sigaction(p, &sa_args)) != 0) {
+ if ((error = sigaction(td, &sa_args)) != 0) {
DPRINTF(("signal: sigaction failed: %d\n",
error));
*retval = (int)SVR4_SIG_ERR;
@@ -437,7 +437,7 @@ sighold:
SCARG(&sa, how) = SIG_BLOCK;
SCARG(&sa, set) = set;
SCARG(&sa, oset) = NULL;
- return sigprocmask(p, &sa);
+ return sigprocmask(td, &sa);
}
case SVR4_SIGRELSE_MASK:
@@ -451,7 +451,7 @@ sighold:
SCARG(&sa, how) = SIG_UNBLOCK;
SCARG(&sa, set) = set;
SCARG(&sa, oset) = NULL;
- return sigprocmask(p, &sa);
+ return sigprocmask(td, &sa);
}
case SVR4_SIGIGNORE_MASK:
@@ -469,7 +469,7 @@ sighold:
sa.sa_flags = 0;
if ((error = copyout(&sa, bsa, sizeof(sa))) != 0)
return error;
- if ((error = sigaction(p, &sa_args)) != 0) {
+ if ((error = sigaction(td, &sa_args)) != 0) {
DPRINTF(("sigignore: sigaction failed\n"));
return error;
}
@@ -482,12 +482,12 @@ sighold:
sigset_t *set;
set = stackgap_alloc(&sg, sizeof(sigset_t));
- PROC_LOCK(p);
- *set = p->p_sigmask;
- PROC_UNLOCK(p);
+ PROC_LOCK(td->td_proc);
+ *set = td->td_proc->p_sigmask;
+ PROC_UNLOCK(td->td_proc);
SIGDELSET(*set, signum);
SCARG(&sa, sigmask) = set;
- return sigsuspend(p, &sa);
+ return sigsuspend(td, &sa);
}
default:
@@ -497,20 +497,20 @@ sighold:
int
-svr4_sys_sigprocmask(p, uap)
- struct proc *p;
+svr4_sys_sigprocmask(td, uap)
+ struct thread *td;
struct svr4_sys_sigprocmask_args *uap;
{
svr4_sigset_t sss;
sigset_t bss;
int error = 0, *retval;
- retval = p->p_retval;
+ retval = td->td_retval;
if (SCARG(uap, oset) != NULL) {
/* Fix the return value first if needed */
- PROC_LOCK(p);
- bsd_to_svr4_sigset(&p->p_sigmask, &sss);
- PROC_UNLOCK(p);
+ PROC_LOCK(td->td_proc);
+ bsd_to_svr4_sigset(&td->td_proc->p_sigmask, &sss);
+ PROC_UNLOCK(td->td_proc);
if ((error = copyout(&sss, SCARG(uap, oset), sizeof(sss))) != 0)
return error;
}
@@ -524,50 +524,50 @@ svr4_sys_sigprocmask(p, uap)
svr4_to_bsd_sigset(&sss, &bss);
- PROC_LOCK(p);
+ PROC_LOCK(td->td_proc);
switch (SCARG(uap, how)) {
case SVR4_SIG_BLOCK:
- SIGSETOR(p->p_sigmask, bss);
- SIG_CANTMASK(p->p_sigmask);
+ SIGSETOR(td->td_proc->p_sigmask, bss);
+ SIG_CANTMASK(td->td_proc->p_sigmask);
break;
case SVR4_SIG_UNBLOCK:
- SIGSETNAND(p->p_sigmask, bss);
+ SIGSETNAND(td->td_proc->p_sigmask, bss);
break;
case SVR4_SIG_SETMASK:
- p->p_sigmask = bss;
- SIG_CANTMASK(p->p_sigmask);
+ td->td_proc->p_sigmask = bss;
+ SIG_CANTMASK(td->td_proc->p_sigmask);
break;
default:
error = EINVAL;
break;
}
- PROC_UNLOCK(p);
+ PROC_UNLOCK(td->td_proc);
return error;
}
int
-svr4_sys_sigpending(p, uap)
- struct proc *p;
+svr4_sys_sigpending(td, uap)
+ struct thread *td;
struct svr4_sys_sigpending_args *uap;
{
sigset_t bss;
int *retval;
svr4_sigset_t sss;
- DPRINTF(("@@@ svr4_sys_sigpending(%d)\n", p->p_pid));
- retval = p->p_retval;
+ DPRINTF(("@@@ svr4_sys_sigpending(%d)\n", td->td_proc->p_pid));
+ retval = td->td_retval;
switch (SCARG(uap, what)) {
case 1: /* sigpending */
if (SCARG(uap, mask) == NULL)
return 0;
- PROC_LOCK(p);
- bss = p->p_siglist;
- SIGSETAND(bss, p->p_sigmask);
- PROC_UNLOCK(p);
+ PROC_LOCK(td->td_proc);
+ bss = td->td_proc->p_siglist;
+ SIGSETAND(bss, td->td_proc->p_sigmask);
+ PROC_UNLOCK(td->td_proc);
bsd_to_svr4_sigset(&bss, &sss);
break;
@@ -590,8 +590,8 @@ svr4_sys_sigpending(p, uap)
}
int
-svr4_sys_sigsuspend(p, uap)
- register struct proc *p;
+svr4_sys_sigsuspend(td, uap)
+ register struct thread *td;
struct svr4_sys_sigsuspend_args *uap;
{
svr4_sigset_t sss;
@@ -607,26 +607,26 @@ svr4_sys_sigsuspend(p, uap)
svr4_to_bsd_sigset(&sss, bss);
SCARG(&sa, sigmask) = bss;
- return sigsuspend(p, &sa);
+ return sigsuspend(td, &sa);
}
int
-svr4_sys_kill(p, uap)
- register struct proc *p;
+svr4_sys_kill(td, uap)
+ register struct thread *td;
struct svr4_sys_kill_args *uap;
{
struct kill_args ka;
SCARG(&ka, pid) = SCARG(uap, pid);
SCARG(&ka, signum) = SVR4_SVR42BSD_SIG(SCARG(uap, signum));
- return kill(p, &ka);
+ return kill(td, &ka);
}
int
-svr4_sys_context(p, uap)
- register struct proc *p;
+svr4_sys_context(td, uap)
+ register struct thread *td;
struct svr4_sys_context_args *uap;
{
struct svr4_ucontext uc;
@@ -634,11 +634,11 @@ svr4_sys_context(p, uap)
switch (uap->func) {
case 0:
- PROC_LOCK(p);
+ PROC_LOCK(td->td_proc);
DPRINTF(("getcontext(%p)\n", uap->uc));
- svr4_getcontext(p, &uc, &p->p_sigmask,
- sigonstack(cpu_getstack(p)));
- PROC_UNLOCK(p);
+ svr4_getcontext(td, &uc, &td->td_proc->p_sigmask,
+ sigonstack(cpu_getstack(td)));
+ PROC_UNLOCK(td->td_proc);
return copyout(&uc, uap->uc, sizeof(uc));
case 1:
@@ -654,7 +654,7 @@ svr4_sys_context(p, uap)
uc.uc_sigmask.bits[i]));
}
#endif
- return svr4_setcontext(p, &uc);
+ return svr4_setcontext(td, &uc);
default:
DPRINTF(("context(%d, %p)\n", uap->func,
@@ -665,12 +665,12 @@ svr4_sys_context(p, uap)
}
int
-svr4_sys_pause(p, uap)
- register struct proc *p;
+svr4_sys_pause(td, uap)
+ register struct thread *td;
struct svr4_sys_pause_args *uap;
{
struct sigsuspend_args bsa;
- SCARG(&bsa, sigmask) = &p->p_sigmask;
- return sigsuspend(p, &bsa);
+ SCARG(&bsa, sigmask) = &td->td_proc->p_sigmask;
+ return sigsuspend(td, &bsa);
}
diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c
index bd14556..b4f2b55 100644
--- a/sys/compat/svr4/svr4_socket.c
+++ b/sys/compat/svr4/svr4_socket.c
@@ -75,8 +75,8 @@ extern TAILQ_HEAD(svr4_sockcache_head, svr4_sockcache_entry) svr4_head;
extern int svr4_str_initialized;
struct sockaddr_un *
-svr4_find_socket(p, fp, dev, ino)
- struct proc *p;
+svr4_find_socket(td, fp, dev, ino)
+ struct thread *td;
struct file *fp;
udev_t dev;
ino_t ino;
@@ -87,7 +87,7 @@ svr4_find_socket(p, fp, dev, ino)
if (svr4_str_initialized != 2) {
if (atomic_cmpset_acq_int(&svr4_str_initialized, 0, 1)) {
DPRINTF(("svr4_find_socket: uninitialized [%p,%d,%d]\n",
- p, dev, ino));
+ td, dev, ino));
TAILQ_INIT(&svr4_head);
atomic_store_rel_int(&svr4_str_initialized, 2);
}
@@ -95,9 +95,9 @@ svr4_find_socket(p, fp, dev, ino)
}
- DPRINTF(("svr4_find_socket: [%p,%d,%d]: ", p, dev, ino));
+ DPRINTF(("svr4_find_socket: [%p,%d,%d]: ", td, dev, ino));
TAILQ_FOREACH(e, &svr4_head, entries)
- if (e->p == p && e->dev == dev && e->ino == ino) {
+ if (e->p == td->td_proc && e->dev == dev && e->ino == ino) {
#ifdef DIAGNOSTIC
if (e->cookie != NULL && e->cookie != cookie)
panic("svr4 socket cookie mismatch");
@@ -117,8 +117,8 @@ svr4_find_socket(p, fp, dev, ino)
* the streams "soo_close()" routine).
*/
int
-svr4_add_socket(p, path, st)
- struct proc *p;
+svr4_add_socket(td, path, st)
+ struct thread *td;
const char *path;
struct stat *st;
{
@@ -142,7 +142,7 @@ svr4_add_socket(p, path, st)
e->cookie = NULL;
e->dev = st->st_dev;
e->ino = st->st_ino;
- e->p = p;
+ e->p = td->td_proc;
if ((error = copyinstr(path, e->sock.sun_path,
sizeof(e->sock.sun_path), &len)) != 0) {
@@ -156,14 +156,14 @@ svr4_add_socket(p, path, st)
TAILQ_INSERT_HEAD(&svr4_head, e, entries);
DPRINTF(("svr4_add_socket: %s [%p,%d,%d]\n", e->sock.sun_path,
- p, e->dev, e->ino));
+ td->td_proc, e->dev, e->ino));
return 0;
}
int
-svr4_sys_socket(p, uap)
- struct proc *p;
+svr4_sys_socket(td, uap)
+ struct thread *td;
struct svr4_sys_socket_args *uap;
{
switch (SCARG(uap, type)) {
@@ -189,5 +189,5 @@ svr4_sys_socket(p, uap)
default:
return EINVAL;
}
- return socket(p, (struct socket_args *)uap);
+ return socket(td, (struct socket_args *)uap);
}
diff --git a/sys/compat/svr4/svr4_socket.h b/sys/compat/svr4/svr4_socket.h
index 96e3582..e860392 100644
--- a/sys/compat/svr4/svr4_socket.h
+++ b/sys/compat/svr4/svr4_socket.h
@@ -38,6 +38,7 @@
struct sockaddr_un;
struct proc;
+struct thread;
struct file;
struct svr4_sockaddr_in {
@@ -47,9 +48,9 @@ struct svr4_sockaddr_in {
u_char sin_zero[8];
};
-struct sockaddr_un *svr4_find_socket __P((struct proc *, struct file *,
+struct sockaddr_un *svr4_find_socket __P((struct thread *, struct file *,
udev_t, ino_t));
void svr4_delete_socket __P((struct proc *, struct file *));
-int svr4_add_socket __P((struct proc *, const char *, struct stat *));
+int svr4_add_socket __P((struct thread *, const char *, struct stat *));
#endif /* _SVR4_SOCKET_H_ */
diff --git a/sys/compat/svr4/svr4_sockio.c b/sys/compat/svr4/svr4_sockio.c
index b96be4d..65cf49a 100644
--- a/sys/compat/svr4/svr4_sockio.c
+++ b/sys/compat/svr4/svr4_sockio.c
@@ -70,9 +70,9 @@ bsd_to_svr4_flags(bf)
}
int
-svr4_sock_ioctl(fp, p, retval, fd, cmd, data)
+svr4_sock_ioctl(fp, td, retval, fd, cmd, data)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -125,7 +125,7 @@ svr4_sock_ioctl(fp, p, retval, fd, cmd, data)
(void) strncpy(br.ifr_name, sr.svr4_ifr_name,
sizeof(br.ifr_name));
if ((error = fo_ioctl(fp, SIOCGIFFLAGS,
- (caddr_t) &br, p)) != 0) {
+ (caddr_t) &br, td)) != 0) {
DPRINTF(("SIOCGIFFLAGS (%s) %s: error %d\n",
br.ifr_name, sr.svr4_ifr_name, error));
return error;
@@ -149,7 +149,7 @@ svr4_sock_ioctl(fp, p, retval, fd, cmd, data)
sc.svr4_ifc_len));
if ((error = fo_ioctl(fp, OSIOCGIFCONF,
- (caddr_t) &sc, p)) != 0)
+ (caddr_t) &sc, td)) != 0)
return error;
DPRINTF(("SIOCGIFCONF\n"));
diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c
index a3f22c8..d44a51b 100644
--- a/sys/compat/svr4/svr4_stat.c
+++ b/sys/compat/svr4/svr4_stat.c
@@ -73,7 +73,7 @@ struct svr4_ustat_args {
static void bsd_to_svr4_xstat __P((struct stat *, struct svr4_xstat *));
static void bsd_to_svr4_stat64 __P((struct stat *, struct svr4_stat64 *));
-int svr4_ustat __P((struct proc *, struct svr4_ustat_args *));
+int svr4_ustat __P((struct thread *, struct svr4_ustat_args *));
static int svr4_to_bsd_pathconf __P((int));
/*
@@ -153,8 +153,8 @@ bsd_to_svr4_stat64(st, st4)
}
int
-svr4_sys_stat(p, uap)
- struct proc *p;
+svr4_sys_stat(td, uap)
+ struct thread *td;
struct svr4_sys_stat_args *uap;
{
struct stat st;
@@ -163,13 +163,13 @@ svr4_sys_stat(p, uap)
int error;
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat));
- if ((error = stat(p, &cup)) != 0)
+ if ((error = stat(td, &cup)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@@ -178,7 +178,7 @@ svr4_sys_stat(p, uap)
bsd_to_svr4_stat(&st, &svr4_st);
if (S_ISSOCK(st.st_mode))
- (void) svr4_add_socket(p, SCARG(uap, path), &st);
+ (void) svr4_add_socket(td, SCARG(uap, path), &st);
if ((error = copyout(&svr4_st, SCARG(uap, ub), sizeof svr4_st)) != 0)
return error;
@@ -188,8 +188,8 @@ svr4_sys_stat(p, uap)
int
-svr4_sys_lstat(p, uap)
- register struct proc *p;
+svr4_sys_lstat(td, uap)
+ register struct thread *td;
struct svr4_sys_lstat_args *uap;
{
struct stat st;
@@ -198,12 +198,12 @@ svr4_sys_lstat(p, uap)
int error;
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat));
- if ((error = lstat(p, &cup)) != 0)
+ if ((error = lstat(td, &cup)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@@ -212,7 +212,7 @@ svr4_sys_lstat(p, uap)
bsd_to_svr4_stat(&st, &svr4_st);
if (S_ISSOCK(st.st_mode))
- (void) svr4_add_socket(p, SCARG(uap, path), &st);
+ (void) svr4_add_socket(td, SCARG(uap, path), &st);
if ((error = copyout(&svr4_st, SCARG(uap, ub), sizeof svr4_st)) != 0)
return error;
@@ -222,8 +222,8 @@ svr4_sys_lstat(p, uap)
int
-svr4_sys_fstat(p, uap)
- register struct proc *p;
+svr4_sys_fstat(td, uap)
+ register struct thread *td;
struct svr4_sys_fstat_args *uap;
{
struct stat st;
@@ -235,7 +235,7 @@ svr4_sys_fstat(p, uap)
SCARG(&cup, fd) = SCARG(uap, fd);
SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(struct stat));
- if ((error = fstat(p, &cup)) != 0)
+ if ((error = fstat(td, &cup)) != 0)
return error;
if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0)
@@ -251,8 +251,8 @@ svr4_sys_fstat(p, uap)
int
-svr4_sys_xstat(p, uap)
- register struct proc *p;
+svr4_sys_xstat(td, uap)
+ register struct thread *td;
struct svr4_sys_xstat_args *uap;
{
struct stat st;
@@ -261,12 +261,12 @@ svr4_sys_xstat(p, uap)
int error;
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat));
- if ((error = stat(p, &cup)) != 0)
+ if ((error = stat(td, &cup)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@@ -276,7 +276,7 @@ svr4_sys_xstat(p, uap)
#if defined(SOCKET_NOTYET)
if (S_ISSOCK(st.st_mode))
- (void) svr4_add_socket(p, SCARG(uap, path), &st);
+ (void) svr4_add_socket(td, SCARG(uap, path), &st);
#endif
if ((error = copyout(&svr4_st, SCARG(uap, ub), sizeof svr4_st)) != 0)
@@ -286,8 +286,8 @@ svr4_sys_xstat(p, uap)
}
int
-svr4_sys_lxstat(p, uap)
- register struct proc *p;
+svr4_sys_lxstat(td, uap)
+ register struct thread *td;
struct svr4_sys_lxstat_args *uap;
{
struct stat st;
@@ -295,12 +295,12 @@ svr4_sys_lxstat(p, uap)
struct lstat_args cup;
int error;
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat));
- if ((error = lstat(p, &cup)) != 0)
+ if ((error = lstat(td, &cup)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@@ -310,7 +310,7 @@ svr4_sys_lxstat(p, uap)
#if defined(SOCKET_NOTYET)
if (S_ISSOCK(st.st_mode))
- (void) svr4_add_socket(p, SCARG(uap, path), &st);
+ (void) svr4_add_socket(td, SCARG(uap, path), &st);
#endif
if ((error = copyout(&svr4_st, SCARG(uap, ub), sizeof svr4_st)) != 0)
return error;
@@ -320,8 +320,8 @@ svr4_sys_lxstat(p, uap)
int
-svr4_sys_fxstat(p, uap)
- register struct proc *p;
+svr4_sys_fxstat(td, uap)
+ register struct thread *td;
struct svr4_sys_fxstat_args *uap;
{
struct stat st;
@@ -334,7 +334,7 @@ svr4_sys_fxstat(p, uap)
SCARG(&cup, fd) = SCARG(uap, fd);
SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(struct stat));
- if ((error = fstat(p, &cup)) != 0)
+ if ((error = fstat(td, &cup)) != 0)
return error;
if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0)
@@ -349,8 +349,8 @@ svr4_sys_fxstat(p, uap)
}
int
-svr4_sys_stat64(p, uap)
- register struct proc *p;
+svr4_sys_stat64(td, uap)
+ register struct thread *td;
struct svr4_sys_stat64_args *uap;
{
struct stat st;
@@ -359,12 +359,12 @@ svr4_sys_stat64(p, uap)
int error;
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat));
- if ((error = stat(p, &cup)) != 0)
+ if ((error = stat(td, &cup)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@@ -373,7 +373,7 @@ svr4_sys_stat64(p, uap)
bsd_to_svr4_stat64(&st, &svr4_st);
if (S_ISSOCK(st.st_mode))
- (void) svr4_add_socket(p, SCARG(uap, path), &st);
+ (void) svr4_add_socket(td, SCARG(uap, path), &st);
if ((error = copyout(&svr4_st, SCARG(uap, sb), sizeof svr4_st)) != 0)
return error;
@@ -383,8 +383,8 @@ svr4_sys_stat64(p, uap)
int
-svr4_sys_lstat64(p, uap)
- register struct proc *p;
+svr4_sys_lstat64(td, uap)
+ register struct thread *td;
struct svr4_sys_lstat64_args *uap;
{
struct stat st;
@@ -393,12 +393,12 @@ svr4_sys_lstat64(p, uap)
int error;
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, (char *) SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, (char *) SCARG(uap, path));
SCARG(&cup, path) = SCARG(uap, path);
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat));
- if ((error = lstat(p, (struct lstat_args *)&cup)) != 0)
+ if ((error = lstat(td, (struct lstat_args *)&cup)) != 0)
return error;
if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0)
@@ -407,7 +407,7 @@ svr4_sys_lstat64(p, uap)
bsd_to_svr4_stat64(&st, &svr4_st);
if (S_ISSOCK(st.st_mode))
- (void) svr4_add_socket(p, SCARG(uap, path), &st);
+ (void) svr4_add_socket(td, SCARG(uap, path), &st);
if ((error = copyout(&svr4_st, SCARG(uap, sb), sizeof svr4_st)) != 0)
return error;
@@ -417,8 +417,8 @@ svr4_sys_lstat64(p, uap)
int
-svr4_sys_fstat64(p, uap)
- register struct proc *p;
+svr4_sys_fstat64(td, uap)
+ register struct thread *td;
struct svr4_sys_fstat64_args *uap;
{
struct stat st;
@@ -430,7 +430,7 @@ svr4_sys_fstat64(p, uap)
SCARG(&cup, fd) = SCARG(uap, fd);
SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(struct stat));
- if ((error = fstat(p, &cup)) != 0)
+ if ((error = fstat(td, &cup)) != 0)
return error;
if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0)
@@ -446,8 +446,8 @@ svr4_sys_fstat64(p, uap)
int
-svr4_ustat(p, uap)
- register struct proc *p;
+svr4_ustat(td, uap)
+ register struct thread *td;
struct svr4_ustat_args *uap;
{
struct svr4_ustat us;
@@ -468,8 +468,8 @@ svr4_ustat(p, uap)
/*extern char ostype[], hostname[], osrelease[], version[], machine[];*/
int
-svr4_sys_uname(p, uap)
- register struct proc *p;
+svr4_sys_uname(td, uap)
+ register struct thread *td;
struct svr4_sys_uname_args *uap;
{
struct svr4_utsname sut;
@@ -497,13 +497,13 @@ svr4_sys_uname(p, uap)
}
int
-svr4_sys_systeminfo(p, uap)
- struct proc *p;
+svr4_sys_systeminfo(td, uap)
+ struct thread *td;
struct svr4_sys_systeminfo_args *uap;
{
char *str = NULL;
int error = 0;
- register_t *retval = p->p_retval;
+ register_t *retval = td->td_retval;
size_t len = 0;
char buf[1]; /* XXX NetBSD uses 256, but that seems
like awfully excessive kstack usage
@@ -563,13 +563,13 @@ svr4_sys_systeminfo(p, uap)
if ((error = suser(p)) != 0)
return error;
name = KERN_HOSTNAME;
- return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, p);
+ return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, td);
case SVR4_SI_SET_SRPC_DOMAIN:
if ((error = suser(p)) != 0)
return error;
name = KERN_NISDOMAINNAME;
- return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, p);
+ return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, td);
#else
case SVR4_SI_SET_HOSTNAME:
case SVR4_SI_SET_SRPC_DOMAIN:
@@ -607,8 +607,8 @@ svr4_sys_systeminfo(p, uap)
}
int
-svr4_sys_utssys(p, uap)
- register struct proc *p;
+svr4_sys_utssys(td, uap)
+ register struct thread *td;
struct svr4_sys_utssys_args *uap;
{
switch (SCARG(uap, sel)) {
@@ -616,7 +616,7 @@ svr4_sys_utssys(p, uap)
{
struct svr4_sys_uname_args ua;
SCARG(&ua, name) = SCARG(uap, a1);
- return svr4_sys_uname(p, &ua);
+ return svr4_sys_uname(td, &ua);
}
case 2: /* ustat(2) */
@@ -624,7 +624,7 @@ svr4_sys_utssys(p, uap)
struct svr4_ustat_args ua;
SCARG(&ua, dev) = (svr4_dev_t) SCARG(uap, a2);
SCARG(&ua, name) = SCARG(uap, a1);
- return svr4_ustat(p, &ua);
+ return svr4_ustat(td, &ua);
}
case 3: /* fusers(2) */
@@ -638,8 +638,8 @@ svr4_sys_utssys(p, uap)
int
-svr4_sys_utime(p, uap)
- register struct proc *p;
+svr4_sys_utime(td, uap)
+ register struct thread *td;
struct svr4_sys_utime_args *uap;
{
struct svr4_utimbuf ub;
@@ -649,7 +649,7 @@ svr4_sys_utime(p, uap)
caddr_t sg = stackgap_init();
void *ttp;
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(&ap, path) = SCARG(uap, path);
if (SCARG(uap, ubuf) != NULL) {
if ((error = copyin(SCARG(uap, ubuf), &ub, sizeof(ub))) != 0)
@@ -666,18 +666,18 @@ svr4_sys_utime(p, uap)
}
else
SCARG(&ap, tptr) = NULL;
- return utimes(p, &ap);
+ return utimes(td, &ap);
}
int
-svr4_sys_utimes(p, uap)
- register struct proc *p;
+svr4_sys_utimes(td, uap)
+ register struct thread *td;
struct svr4_sys_utimes_args *uap;
{
caddr_t sg = stackgap_init();
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
- return utimes(p, (struct utimes_args *)uap);
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
+ return utimes(td, (struct utimes_args *)uap);
}
static int
@@ -730,14 +730,14 @@ svr4_to_bsd_pathconf(name)
int
-svr4_sys_pathconf(p, uap)
- register struct proc *p;
+svr4_sys_pathconf(td, uap)
+ register struct thread *td;
struct svr4_sys_pathconf_args *uap;
{
caddr_t sg = stackgap_init();
- register_t *retval = p->p_retval;
+ register_t *retval = td->td_retval;
- CHECKALTEXIST(p, &sg, SCARG(uap, path));
+ CHECKALTEXIST(td, &sg, SCARG(uap, path));
SCARG(uap, name) = svr4_to_bsd_pathconf(SCARG(uap, name));
@@ -749,17 +749,17 @@ svr4_sys_pathconf(p, uap)
*retval = 0;
return 0;
default:
- return pathconf(p, (struct pathconf_args *)uap);
+ return pathconf(td, (struct pathconf_args *)uap);
}
}
int
-svr4_sys_fpathconf(p, uap)
- register struct proc *p;
+svr4_sys_fpathconf(td, uap)
+ register struct thread *td;
struct svr4_sys_fpathconf_args *uap;
{
- register_t *retval = p->p_retval;
+ register_t *retval = td->td_retval;
SCARG(uap, name) = svr4_to_bsd_pathconf(SCARG(uap, name));
@@ -771,6 +771,6 @@ svr4_sys_fpathconf(p, uap)
*retval = 0;
return 0;
default:
- return fpathconf(p, (struct fpathconf_args *)uap);
+ return fpathconf(td, (struct fpathconf_args *)uap);
}
}
diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c
index 45a2a5e..cb19305 100644
--- a/sys/compat/svr4/svr4_stream.c
+++ b/sys/compat/svr4/svr4_stream.c
@@ -75,7 +75,7 @@
#include <compat/svr4/svr4_socket.h>
/* Utils */
-static int clean_pipe __P((struct proc *, const char *));
+static int clean_pipe __P((struct thread *, const char *));
static void getparm __P((struct file *, struct svr4_si_sockparms *));
/* Address Conversions */
@@ -89,48 +89,48 @@ static void netaddr_to_sockaddr_un __P((struct sockaddr_un *,
const struct svr4_strmcmd *));
/* stream ioctls */
-static int i_nread __P((struct file *, struct proc *, register_t *, int,
+static int i_nread __P((struct file *, struct thread *, 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 thread *, 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 thread *, 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 thread *, 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 thread *, 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 thread *, 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 thread *, register_t *, int,
u_long, caddr_t));
/* i_str sockmod calls */
static int sockmod __P((struct file *, int, struct svr4_strioctl *,
- struct proc *));
+ struct thread *));
static int si_listen __P((struct file *, int, struct svr4_strioctl *,
- struct proc *));
+ struct thread *));
static int si_ogetudata __P((struct file *, int, struct svr4_strioctl *,
- struct proc *));
+ struct thread *));
static int si_sockparams __P((struct file *, int, struct svr4_strioctl *,
- struct proc *));
+ struct thread *));
static int si_shutdown __P((struct file *, int, struct svr4_strioctl *,
- struct proc *));
+ struct thread *));
static int si_getudata __P((struct file *, int, struct svr4_strioctl *,
- struct proc *));
+ struct thread *));
/* i_str timod calls */
static int timod __P((struct file *, int, struct svr4_strioctl *,
- struct proc *));
+ struct thread *));
static int ti_getinfo __P((struct file *, int, struct svr4_strioctl *,
- struct proc *));
+ struct thread *));
static int ti_bind __P((struct file *, int, struct svr4_strioctl *,
- struct proc *));
+ struct thread *));
/* infrastructure */
-static int svr4_sendit __P((struct proc *p, int s, struct msghdr *mp,
+static int svr4_sendit __P((struct thread *td, int s, struct msghdr *mp,
int flags));
-static int svr4_recvit __P((struct proc *p, int s, struct msghdr *mp,
+static int svr4_recvit __P((struct thread *td, int s, struct msghdr *mp,
caddr_t namelenp));
/* <sigh> Ok, so we shouldn't use sendit() in uipc_syscalls.c because
@@ -144,8 +144,8 @@ static int svr4_recvit __P((struct proc *p, int s, struct msghdr *mp,
* I will take out all the #ifdef COMPAT_OLDSOCK gumph, though.
*/
static int
-svr4_sendit(p, s, mp, flags)
- register struct proc *p;
+svr4_sendit(td, s, mp, flags)
+ register struct thread *td;
int s;
register struct msghdr *mp;
int flags;
@@ -163,27 +163,27 @@ svr4_sendit(p, s, mp, flags)
struct uio ktruio;
#endif
- error = holdsock(p->p_fd, s, &fp);
+ error = holdsock(td->td_proc->p_fd, s, &fp);
if (error)
return (error);
auio.uio_iov = mp->msg_iov;
auio.uio_iovcnt = mp->msg_iovlen;
auio.uio_segflg = UIO_USERSPACE;
auio.uio_rw = UIO_WRITE;
- auio.uio_procp = p;
+ auio.uio_td = td;
auio.uio_offset = 0; /* XXX */
auio.uio_resid = 0;
iov = mp->msg_iov;
for (i = 0; i < mp->msg_iovlen; i++, iov++) {
if ((auio.uio_resid += iov->iov_len) < 0) {
- fdrop(fp, p);
+ fdrop(fp, td);
return (EINVAL);
}
}
if (mp->msg_name) {
error = getsockaddr(&to, mp->msg_name, mp->msg_namelen);
if (error) {
- fdrop(fp, p);
+ fdrop(fp, td);
return (error);
}
} else {
@@ -202,7 +202,7 @@ svr4_sendit(p, s, mp, flags)
control = 0;
}
#ifdef KTRACE
- if (KTRPOINT(p, KTR_GENIO)) {
+ if (KTRPOINT(td->td_proc, KTR_GENIO)) {
int iovlen = auio.uio_iovcnt * sizeof (struct iovec);
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK);
@@ -213,25 +213,25 @@ svr4_sendit(p, s, mp, flags)
len = auio.uio_resid;
so = (struct socket *)fp->f_data;
error = so->so_proto->pr_usrreqs->pru_sosend(so, to, &auio, 0, control,
- flags, p);
+ flags, td);
if (error) {
if (auio.uio_resid != len && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))
error = 0;
if (error == EPIPE) {
- PROC_LOCK(p);
- psignal(p, SIGPIPE);
- PROC_UNLOCK(p);
+ PROC_LOCK(td->td_proc);
+ psignal(td->td_proc, SIGPIPE);
+ PROC_UNLOCK(td->td_proc);
}
}
if (error == 0)
- p->p_retval[0] = len - auio.uio_resid;
+ td->td_retval[0] = len - auio.uio_resid;
#ifdef KTRACE
if (ktriov != NULL) {
if (error == 0) {
ktruio.uio_iov = ktriov;
- ktruio.uio_resid = p->p_retval[0];
- ktrgenio(p->p_tracep, s, UIO_WRITE, &ktruio, error);
+ ktruio.uio_resid = td->td_retval[0];
+ ktrgenio(td->td_proc->p_tracep, s, UIO_WRITE, &ktruio, error);
}
FREE(ktriov, M_TEMP);
}
@@ -239,13 +239,13 @@ svr4_sendit(p, s, mp, flags)
bad:
if (to)
FREE(to, M_SONAME);
- fdrop(fp, p);
+ fdrop(fp, td);
return (error);
}
static int
-svr4_recvit(p, s, mp, namelenp)
- register struct proc *p;
+svr4_recvit(td, s, mp, namelenp)
+ register struct thread *td;
int s;
register struct msghdr *mp;
caddr_t namelenp;
@@ -264,25 +264,25 @@ svr4_recvit(p, s, mp, namelenp)
struct uio ktruio;
#endif
- error = holdsock(p->p_fd, s, &fp);
+ error = holdsock(td->td_proc->p_fd, s, &fp);
if (error)
return (error);
auio.uio_iov = mp->msg_iov;
auio.uio_iovcnt = mp->msg_iovlen;
auio.uio_segflg = UIO_USERSPACE;
auio.uio_rw = UIO_READ;
- auio.uio_procp = p;
+ auio.uio_td = td;
auio.uio_offset = 0; /* XXX */
auio.uio_resid = 0;
iov = mp->msg_iov;
for (i = 0; i < mp->msg_iovlen; i++, iov++) {
if ((auio.uio_resid += iov->iov_len) < 0) {
- fdrop(fp, p);
+ fdrop(fp, td);
return (EINVAL);
}
}
#ifdef KTRACE
- if (KTRPOINT(p, KTR_GENIO)) {
+ if (KTRPOINT(td->td_proc, KTR_GENIO)) {
int iovlen = auio.uio_iovcnt * sizeof (struct iovec);
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK);
@@ -305,14 +305,14 @@ svr4_recvit(p, s, mp, namelenp)
if (error == 0) {
ktruio.uio_iov = ktriov;
ktruio.uio_resid = len - auio.uio_resid;
- ktrgenio(p->p_tracep, s, UIO_READ, &ktruio, error);
+ ktrgenio(td->td_proc->p_tracep, s, UIO_READ, &ktruio, error);
}
FREE(ktriov, M_TEMP);
}
#endif
if (error)
goto out;
- p->p_retval[0] = len - auio.uio_resid;
+ td->td_retval[0] = len - auio.uio_resid;
if (mp->msg_name) {
len = mp->msg_namelen;
if (len <= 0 || fromsa == 0)
@@ -365,7 +365,7 @@ out:
FREE(fromsa, M_SONAME);
if (control)
m_freem(control);
- fdrop(fp, p);
+ fdrop(fp, td);
return (error);
}
@@ -499,8 +499,8 @@ show_msg(str, fd, ctl, dat, flags)
* to avoid code duplication.
*/
static int
-clean_pipe(p, path)
- struct proc *p;
+clean_pipe(td, path)
+ struct thread *td;
const char *path;
{
struct lstat_args la;
@@ -519,7 +519,7 @@ clean_pipe(p, path)
SCARG(&la, path) = tpath;
- if ((error = lstat(p, &la)) != 0)
+ if ((error = lstat(td, &la)) != 0)
return 0;
if ((error = copyin(SCARG(&la, ub), &st, sizeof(st))) != 0)
@@ -536,7 +536,7 @@ clean_pipe(p, path)
SCARG(&ua, path) = SCARG(&la, path);
- if ((error = unlink(p, &ua)) != 0) {
+ if ((error = unlink(td, &ua)) != 0) {
DPRINTF(("clean_pipe: unlink failed %d\n", error));
return error;
}
@@ -662,11 +662,11 @@ getparm(fp, pa)
static int
-si_ogetudata(fp, fd, ioc, p)
+si_ogetudata(fp, fd, ioc, td)
struct file *fp;
int fd;
struct svr4_strioctl *ioc;
- struct proc *p;
+ struct thread *td;
{
int error;
struct svr4_si_oudata ud;
@@ -719,11 +719,11 @@ si_ogetudata(fp, fd, ioc, p)
static int
-si_sockparams(fp, fd, ioc, p)
+si_sockparams(fp, fd, ioc, td)
struct file *fp;
int fd;
struct svr4_strioctl *ioc;
- struct proc *p;
+ struct thread *td;
{
struct svr4_si_sockparms pa;
@@ -733,11 +733,11 @@ si_sockparams(fp, fd, ioc, p)
static int
-si_listen(fp, fd, ioc, p)
+si_listen(fp, fd, ioc, td)
struct file *fp;
int fd;
struct svr4_strioctl *ioc;
- struct proc *p;
+ struct thread *td;
{
int error;
struct svr4_strm *st = svr4_stream_get(fp);
@@ -762,7 +762,7 @@ si_listen(fp, fd, ioc, p)
DPRINTF(("SI_LISTEN: fileno %d backlog = %d\n", fd, 5));
SCARG(&la, backlog) = 5;
- if ((error = listen(p, &la)) != 0) {
+ if ((error = listen(td, &la)) != 0) {
DPRINTF(("SI_LISTEN: listen failed %d\n", error));
return error;
}
@@ -797,11 +797,11 @@ si_listen(fp, fd, ioc, p)
static int
-si_getudata(fp, fd, ioc, p)
+si_getudata(fp, fd, ioc, td)
struct file *fp;
int fd;
struct svr4_strioctl *ioc;
- struct proc *p;
+ struct thread *td;
{
int error;
struct svr4_si_udata ud;
@@ -856,11 +856,11 @@ si_getudata(fp, fd, ioc, p)
static int
-si_shutdown(fp, fd, ioc, p)
+si_shutdown(fp, fd, ioc, td)
struct file *fp;
int fd;
struct svr4_strioctl *ioc;
- struct proc *p;
+ struct thread *td;
{
int error;
struct shutdown_args ap;
@@ -876,29 +876,29 @@ si_shutdown(fp, fd, ioc, p)
SCARG(&ap, s) = fd;
- return shutdown(p, &ap);
+ return shutdown(td, &ap);
}
static int
-sockmod(fp, fd, ioc, p)
+sockmod(fp, fd, ioc, td)
struct file *fp;
int fd;
struct svr4_strioctl *ioc;
- struct proc *p;
+ struct thread *td;
{
switch (ioc->cmd) {
case SVR4_SI_OGETUDATA:
DPRINTF(("SI_OGETUDATA\n"));
- return si_ogetudata(fp, fd, ioc, p);
+ return si_ogetudata(fp, fd, ioc, td);
case SVR4_SI_SHUTDOWN:
DPRINTF(("SI_SHUTDOWN\n"));
- return si_shutdown(fp, fd, ioc, p);
+ return si_shutdown(fp, fd, ioc, td);
case SVR4_SI_LISTEN:
DPRINTF(("SI_LISTEN\n"));
- return si_listen(fp, fd, ioc, p);
+ return si_listen(fp, fd, ioc, td);
case SVR4_SI_SETMYNAME:
DPRINTF(("SI_SETMYNAME\n"));
@@ -922,11 +922,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, td);
case SVR4_SI_GETUDATA:
DPRINTF(("SI_GETUDATA\n"));
- return si_getudata(fp, fd, ioc, p);
+ return si_getudata(fp, fd, ioc, td);
default:
DPRINTF(("Unknown sockmod ioctl %lx\n", ioc->cmd));
@@ -937,11 +937,11 @@ sockmod(fp, fd, ioc, p)
static int
-ti_getinfo(fp, fd, ioc, p)
+ti_getinfo(fp, fd, ioc, td)
struct file *fp;
int fd;
struct svr4_strioctl *ioc;
- struct proc *p;
+ struct thread *td;
{
int error;
struct svr4_infocmd info;
@@ -975,11 +975,11 @@ ti_getinfo(fp, fd, ioc, p)
static int
-ti_bind(fp, fd, ioc, p)
+ti_bind(fp, fd, ioc, td)
struct file *fp;
int fd;
struct svr4_strioctl *ioc;
- struct proc *p;
+ struct thread *td;
{
int error;
struct svr4_strm *st = svr4_stream_get(fp);
@@ -1033,7 +1033,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(td, saun.sun_path)) != 0)
return error;
bnd.pad[28] = 0x00001000; /* magic again */
@@ -1056,7 +1056,7 @@ ti_bind(fp, fd, ioc, p)
SCARG(&ba, name) = (void *) sup;
SCARG(&ba, namelen) = sasize;
- if ((error = bind(p, &ba)) != 0) {
+ if ((error = bind(td, &ba)) != 0) {
DPRINTF(("TI_BIND: bind failed %d\n", error));
return error;
}
@@ -1078,16 +1078,16 @@ reply:
static int
-timod(fp, fd, ioc, p)
+timod(fp, fd, ioc, td)
struct file *fp;
int fd;
struct svr4_strioctl *ioc;
- struct proc *p;
+ struct thread *td;
{
switch (ioc->cmd) {
case SVR4_TI_GETINFO:
DPRINTF(("TI_GETINFO\n"));
- return ti_getinfo(fp, fd, ioc, p);
+ return ti_getinfo(fp, fd, ioc, td);
case SVR4_TI_OPTMGMT:
DPRINTF(("TI_OPTMGMT\n"));
@@ -1095,7 +1095,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, td);
case SVR4_TI_UNBIND:
DPRINTF(("TI_UNBIND\n"));
@@ -1109,9 +1109,9 @@ timod(fp, fd, ioc, p)
int
-svr4_stream_ti_ioctl(fp, p, retval, fd, cmd, dat)
+svr4_stream_ti_ioctl(fp, td, retval, fd, cmd, dat)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -1174,7 +1174,7 @@ svr4_stream_ti_ioctl(fp, p, retval, fd, cmd, dat)
SCARG(&ap, fdes) = fd;
SCARG(&ap, asa) = sup;
SCARG(&ap, alen) = lenp;
- if ((error = getsockname(p, &ap)) != 0) {
+ if ((error = getsockname(td, &ap)) != 0) {
DPRINTF(("ti_ioctl: getsockname error\n"));
return error;
}
@@ -1188,7 +1188,7 @@ svr4_stream_ti_ioctl(fp, p, retval, fd, cmd, dat)
SCARG(&ap, fdes) = fd;
SCARG(&ap, asa) = sup;
SCARG(&ap, alen) = lenp;
- if ((error = getpeername(p, &ap)) != 0) {
+ if ((error = getpeername(td, &ap)) != 0) {
DPRINTF(("ti_ioctl: getpeername error\n"));
return error;
}
@@ -1251,9 +1251,9 @@ svr4_stream_ti_ioctl(fp, p, retval, fd, cmd, dat)
static int
-i_nread(fp, p, retval, fd, cmd, dat)
+i_nread(fp, td, retval, fd, cmd, dat)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -1269,7 +1269,7 @@ i_nread(fp, p, retval, fd, cmd, dat)
* for us, and if we do, then we assume that we have at least one
* message waiting for us.
*/
- if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, p)) != 0)
+ if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, td)) != 0)
return error;
if (nread != 0)
@@ -1281,9 +1281,9 @@ i_nread(fp, p, retval, fd, cmd, dat)
}
static int
-i_fdinsert(fp, p, retval, fd, cmd, dat)
+i_fdinsert(fp, td, retval, fd, cmd, dat)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -1321,7 +1321,7 @@ i_fdinsert(fp, p, retval, fd, cmd, dat)
SCARG(&d2p, from) = st->s_afd;
SCARG(&d2p, to) = fdi.fd;
- if ((error = dup2(p, &d2p)) != 0) {
+ if ((error = dup2(td, &d2p)) != 0) {
DPRINTF(("fdinsert: dup2(%d, %d) failed %d\n",
st->s_afd, fdi.fd, error));
return error;
@@ -1329,7 +1329,7 @@ i_fdinsert(fp, p, retval, fd, cmd, dat)
SCARG(&clp, fd) = st->s_afd;
- if ((error = close(p, &clp)) != 0) {
+ if ((error = close(td, &clp)) != 0) {
DPRINTF(("fdinsert: close(%d) failed %d\n",
st->s_afd, error));
return error;
@@ -1343,9 +1343,9 @@ i_fdinsert(fp, p, retval, fd, cmd, dat)
static int
-_i_bind_rsvd(fp, p, retval, fd, cmd, dat)
+_i_bind_rsvd(fp, td, retval, fd, cmd, dat)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -1363,13 +1363,13 @@ _i_bind_rsvd(fp, p, retval, fd, cmd, dat)
SCARG(&ap, path) = dat;
SCARG(&ap, mode) = S_IFIFO;
- return mkfifo(p, &ap);
+ return mkfifo(td, &ap);
}
static int
-_i_rele_rsvd(fp, p, retval, fd, cmd, dat)
+_i_rele_rsvd(fp, td, retval, fd, cmd, dat)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -1383,13 +1383,13 @@ _i_rele_rsvd(fp, p, retval, fd, cmd, dat)
*/
SCARG(&ap, path) = dat;
- return unlink(p, &ap);
+ return unlink(td, &ap);
}
static int
-i_str(fp, p, retval, fd, cmd, dat)
+i_str(fp, td, retval, fd, cmd, dat)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -1408,12 +1408,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, td)) != 0)
return error;
break;
case SVR4_TIMOD:
- if ((error = timod(fp, fd, &ioc, p)) != 0)
+ if ((error = timod(fp, fd, &ioc, td)) != 0)
return error;
break;
@@ -1431,9 +1431,9 @@ i_str(fp, p, retval, fd, cmd, dat)
}
static int
-i_setsig(fp, p, retval, fd, cmd, dat)
+i_setsig(fp, td, retval, fd, cmd, dat)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -1459,10 +1459,10 @@ i_setsig(fp, p, retval, fd, cmd, dat)
/* get old status flags */
SCARG(&fa, fd) = fd;
SCARG(&fa, cmd) = F_GETFL;
- if ((error = fcntl(p, &fa)) != 0)
+ if ((error = fcntl(td, &fa)) != 0)
return error;
- oflags = p->p_retval[0];
+ oflags = td->td_retval[0];
/* update the flags */
if (dat != NULL) {
@@ -1488,24 +1488,24 @@ i_setsig(fp, p, retval, fd, cmd, dat)
if (flags != oflags) {
SCARG(&fa, cmd) = F_SETFL;
SCARG(&fa, arg) = (long) flags;
- if ((error = fcntl(p, &fa)) != 0)
+ if ((error = fcntl(td, &fa)) != 0)
return error;
- flags = p->p_retval[0];
+ flags = td->td_retval[0];
}
/* set up SIGIO receiver if needed */
if (dat != NULL) {
SCARG(&fa, cmd) = F_SETOWN;
- SCARG(&fa, arg) = (long) p->p_pid;
- return fcntl(p, &fa);
+ SCARG(&fa, arg) = (long) td->td_proc->p_pid;
+ return fcntl(td, &fa);
}
return 0;
}
static int
-i_getsig(fp, p, retval, fd, cmd, dat)
+i_getsig(fp, td, retval, fd, cmd, dat)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -1530,9 +1530,9 @@ i_getsig(fp, p, retval, fd, cmd, dat)
}
int
-svr4_stream_ioctl(fp, p, retval, fd, cmd, dat)
+svr4_stream_ioctl(fp, td, retval, fd, cmd, dat)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -1546,7 +1546,7 @@ svr4_stream_ioctl(fp, p, retval, fd, cmd, dat)
switch (cmd) {
case SVR4_I_NREAD:
DPRINTF(("I_NREAD\n"));
- return i_nread(fp, p, retval, fd, cmd, dat);
+ return i_nread(fp, td, retval, fd, cmd, dat);
case SVR4_I_PUSH:
DPRINTF(("I_PUSH %p\n", dat));
@@ -1577,15 +1577,15 @@ svr4_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, td, 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, td, 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, td, retval, fd, cmd, dat);
case SVR4_I_FIND:
DPRINTF(("I_FIND\n"));
@@ -1614,7 +1614,7 @@ svr4_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, td, retval, fd, cmd, dat);
case SVR4_I_SENDFD:
DPRINTF(("I_SENDFD\n"));
@@ -1690,11 +1690,11 @@ svr4_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, td, 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, td, retval, fd, cmd, dat);
default:
DPRINTF(("unimpl cmd = %lx\n", cmd));
@@ -1707,11 +1707,11 @@ svr4_stream_ioctl(fp, p, retval, fd, cmd, dat)
int
-svr4_sys_putmsg(p, uap)
- register struct proc *p;
+svr4_sys_putmsg(td, uap)
+ register struct thread *td;
struct svr4_sys_putmsg_args *uap;
{
- struct filedesc *fdp = p->p_fd;
+ struct filedesc *fdp = td->td_proc->p_fd;
struct file *fp;
struct svr4_strbuf dat, ctl;
struct svr4_strmcmd sc;
@@ -1723,7 +1723,7 @@ svr4_sys_putmsg(p, uap)
int error;
caddr_t sg;
- retval = p->p_retval;
+ retval = td->td_retval;
fp = fdp->fd_ofiles[SCARG(uap, fd)];
if (((u_int)SCARG(uap, fd) >= fdp->fd_nfiles) || (fp == NULL)) {
@@ -1802,7 +1802,7 @@ svr4_sys_putmsg(p, uap)
SCARG(&wa, fd) = SCARG(uap, fd);
SCARG(&wa, buf) = dat.buf;
SCARG(&wa, nbyte) = dat.len;
- return write(p, &wa);
+ return write(td, &wa);
}
DPRINTF(("putmsg: Invalid inet length %ld\n", sc.len));
return EINVAL;
@@ -1824,7 +1824,7 @@ svr4_sys_putmsg(p, uap)
/* Maybe we've been given a device/inode pair */
udev_t *dev = SVR4_ADDROF(&sc);
ino_t *ino = (ino_t *) &dev[1];
- skp = svr4_find_socket(p, fp, *dev, *ino);
+ skp = svr4_find_socket(td, fp, *dev, *ino);
if (skp == NULL) {
skp = &saun;
/* I guess we have it by name */
@@ -1855,7 +1855,7 @@ svr4_sys_putmsg(p, uap)
SCARG(&co, name) = (void *) sup;
SCARG(&co, namelen) = (int) sasize;
- return connect(p, &co);
+ return connect(td, &co);
}
case SVR4_TI_SENDTO_REQUEST: /* sendto */
@@ -1873,9 +1873,9 @@ svr4_sys_putmsg(p, uap)
aiov.iov_len = dat.len;
#if 0
error = so->so_proto->pr_usrreqs->pru_sosend(so, 0,
- uio, 0, 0, 0, uio->uio_procp);
+ uio, 0, 0, 0, uio->uio_td);
#endif
- error = svr4_sendit(p, SCARG(uap, fd), &msg,
+ error = svr4_sendit(td, SCARG(uap, fd), &msg,
SCARG(uap, flags));
DPRINTF(("sendto_request error: %d\n", error));
*retval = 0;
@@ -1889,11 +1889,11 @@ svr4_sys_putmsg(p, uap)
}
int
-svr4_sys_getmsg(p, uap)
- register struct proc *p;
+svr4_sys_getmsg(td, uap)
+ register struct thread *td;
struct svr4_sys_getmsg_args *uap;
{
- struct filedesc *fdp = p->p_fd;
+ struct filedesc *fdp = td->td_proc->p_fd;
struct file *fp;
struct getpeername_args ga;
struct accept_args aa;
@@ -1911,7 +1911,7 @@ svr4_sys_getmsg(p, uap)
int fl;
caddr_t sg;
- retval = p->p_retval;
+ retval = td->td_retval;
fp = fdp->fd_ofiles[SCARG(uap, fd)];
if (((u_int)SCARG(uap, fd) >= fdp->fd_nfiles) || (fp == NULL))
@@ -2010,7 +2010,7 @@ svr4_sys_getmsg(p, uap)
SCARG(&ga, asa) = (void *) sup;
SCARG(&ga, alen) = flen;
- if ((error = getpeername(p, &ga)) != 0) {
+ if ((error = getpeername(td, &ga)) != 0) {
DPRINTF(("getmsg: getpeername failed %d\n", error));
return error;
}
@@ -2069,7 +2069,7 @@ svr4_sys_getmsg(p, uap)
SCARG(&aa, name) = (void *) sup;
SCARG(&aa, anamelen) = flen;
- if ((error = accept(p, &aa)) != 0) {
+ if ((error = accept(td, &aa)) != 0) {
DPRINTF(("getmsg: accept failed %d\n", error));
return error;
}
@@ -2140,7 +2140,7 @@ svr4_sys_getmsg(p, uap)
aiov.iov_len = dat.maxlen;
msg.msg_flags = 0;
- error = svr4_recvit(p, SCARG(uap, fd), &msg, (caddr_t) flen);
+ error = svr4_recvit(td, SCARG(uap, fd), &msg, (caddr_t) flen);
if (error) {
DPRINTF(("getmsg: recvit failed %d\n", error));
@@ -2191,7 +2191,7 @@ svr4_sys_getmsg(p, uap)
SCARG(&ra, fd) = SCARG(uap, fd);
SCARG(&ra, buf) = dat.buf;
SCARG(&ra, nbyte) = dat.maxlen;
- if ((error = read(p, &ra)) != 0) {
+ if ((error = read(td, &ra)) != 0) {
return error;
}
dat.len = *retval;
@@ -2231,8 +2231,8 @@ svr4_sys_getmsg(p, uap)
return error;
}
-int svr4_sys_send(p, uap)
- struct proc *p;
+int svr4_sys_send(td, uap)
+ struct thread *td;
struct svr4_sys_send_args *uap;
{
struct osend_args osa;
@@ -2240,11 +2240,11 @@ int svr4_sys_send(p, uap)
SCARG(&osa, buf) = SCARG(uap, buf);
SCARG(&osa, len) = SCARG(uap, len);
SCARG(&osa, flags) = SCARG(uap, flags);
- return osend(p, &osa);
+ return osend(td, &osa);
}
-int svr4_sys_recv(p, uap)
- struct proc *p;
+int svr4_sys_recv(td, uap)
+ struct thread *td;
struct svr4_sys_recv_args *uap;
{
struct orecv_args ora;
@@ -2252,7 +2252,7 @@ int svr4_sys_recv(p, uap)
SCARG(&ora, buf) = SCARG(uap, buf);
SCARG(&ora, len) = SCARG(uap, len);
SCARG(&ora, flags) = SCARG(uap, flags);
- return orecv(p, &ora);
+ return orecv(td, &ora);
}
/*
@@ -2260,8 +2260,8 @@ int svr4_sys_recv(p, uap)
* sendto(). Let's leave it here for now...
*/
int
-svr4_sys_sendto(p, uap)
- struct proc *p;
+svr4_sys_sendto(td, uap)
+ struct thread *td;
struct svr4_sys_sendto_args *uap;
{
struct sendto_args sa;
@@ -2274,6 +2274,6 @@ svr4_sys_sendto(p, uap)
SCARG(&sa, tolen) = SCARG(uap, tolen);
DPRINTF(("calling sendto()\n"));
- return sendto(p, &sa);
+ return sendto(td, &sa);
}
diff --git a/sys/compat/svr4/svr4_syscall.h b/sys/compat/svr4/svr4_syscall.h
index 9d25526..b1898b5 100644
--- a/sys/compat/svr4/svr4_syscall.h
+++ b/sys/compat/svr4/svr4_syscall.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: src/sys/svr4/syscalls.master,v 1.10 2000/07/29 10:05:24 peter Exp
+ * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.11 2000/08/31 22:54:05 obrien Exp
*/
#define SVR4_SYS_exit 1
diff --git a/sys/compat/svr4/svr4_syscallnames.c b/sys/compat/svr4/svr4_syscallnames.c
index 479a6b7..1f9add4 100644
--- a/sys/compat/svr4/svr4_syscallnames.c
+++ b/sys/compat/svr4/svr4_syscallnames.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: src/sys/svr4/syscalls.master,v 1.10 2000/07/29 10:05:24 peter Exp
+ * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.11 2000/08/31 22:54:05 obrien Exp
*/
char *svr4_syscallnames[] = {
diff --git a/sys/compat/svr4/svr4_sysent.c b/sys/compat/svr4/svr4_sysent.c
index bad9e4e..2bb003e 100644
--- a/sys/compat/svr4/svr4_sysent.c
+++ b/sys/compat/svr4/svr4_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: src/sys/svr4/syscalls.master,v 1.10 2000/07/29 10:05:24 peter Exp
+ * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.11 2000/08/31 22:54:05 obrien Exp
*/
#include <sys/types.h>
diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c
index 9137e0c..39aa904 100644
--- a/sys/compat/svr4/svr4_sysvec.c
+++ b/sys/compat/svr4/svr4_sysvec.c
@@ -238,14 +238,15 @@ svr4_fixup(register_t **stack_base, struct image_params *imgp)
* Code shamelessly stolen by Mark Newton from IBCS2 emulation code.
*/
int
-svr4_emul_find(p, sgp, prefix, path, pbuf, cflag)
- struct proc *p;
+svr4_emul_find(td, sgp, prefix, path, pbuf, cflag)
+ struct thread *td;
caddr_t *sgp; /* Pointer to stackgap memory */
const char *prefix;
char *path;
char **pbuf;
int cflag;
{
+ struct proc *p = td->td_proc;
struct nameidata nd;
struct nameidata ndroot;
struct vattr vat;
@@ -292,7 +293,7 @@ svr4_emul_find(p, sgp, prefix, path, pbuf, cflag)
for (cp = &ptr[len] - 1; *cp != '/'; cp--);
*cp = '\0';
- NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, p);
+ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td);
if ((error = namei(&nd)) != 0) {
free(buf, M_TEMP);
@@ -303,7 +304,7 @@ svr4_emul_find(p, sgp, prefix, path, pbuf, cflag)
*cp = '/';
}
else {
- NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, p);
+ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td);
if ((error = namei(&nd)) != 0) {
free(buf, M_TEMP);
@@ -320,7 +321,7 @@ svr4_emul_find(p, sgp, prefix, path, pbuf, cflag)
* to the emulation root directory. This is expensive :-(
*/
NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, svr4_emul_path,
- p);
+ td);
if ((error = namei(&ndroot)) != 0) {
/* Cannot happen! */
@@ -330,11 +331,11 @@ svr4_emul_find(p, sgp, prefix, path, pbuf, cflag)
}
NDFREE(&ndroot, NDF_ONLY_PNBUF);
- if ((error = VOP_GETATTR(nd.ni_vp, &vat, p->p_ucred, p)) != 0) {
+ if ((error = VOP_GETATTR(nd.ni_vp, &vat, p->p_ucred, td)) != 0) {
goto done;
}
- if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, p->p_ucred, p))
+ if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, p->p_ucred, td))
!= 0) {
goto done;
}
diff --git a/sys/compat/svr4/svr4_termios.c b/sys/compat/svr4/svr4_termios.c
index d50f97f..981aef8 100644
--- a/sys/compat/svr4/svr4_termios.c
+++ b/sys/compat/svr4/svr4_termios.c
@@ -478,9 +478,9 @@ svr4_termios_to_termio(ts, t)
}
int
-svr4_term_ioctl(fp, p, retval, fd, cmd, data)
+svr4_term_ioctl(fp, td, retval, fd, cmd, data)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -499,7 +499,7 @@ svr4_term_ioctl(fp, p, retval, fd, cmd, data)
case SVR4_TCGETA:
case SVR4_TCGETS:
DPRINTF(("ioctl(TCGET%c);\n", cmd == SVR4_TCGETA ? 'A' : 'S'));
- if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, p)) != 0)
+ if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0)
return error;
memset(&st, 0, sizeof(st));
@@ -526,7 +526,7 @@ svr4_term_ioctl(fp, p, retval, fd, cmd, data)
case SVR4_TCSETSF:
DPRINTF(("TCSET{A,S,AW,SW,AF,SF}\n"));
/* get full BSD termios so we don't lose information */
- if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, p)) != 0)
+ if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0)
return error;
switch (cmd) {
@@ -577,14 +577,14 @@ svr4_term_ioctl(fp, p, retval, fd, cmd, data)
print_svr4_termios(&st);
#endif /* DEBUG_SVR4 */
- return fo_ioctl(fp, cmd, (caddr_t) &bt, p);
+ return fo_ioctl(fp, cmd, (caddr_t) &bt, td);
case SVR4_TIOCGWINSZ:
DPRINTF(("TIOCGWINSZ\n"));
{
struct svr4_winsize ws;
- error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws, p);
+ error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws, td);
if (error)
return error;
return copyout(&ws, data, sizeof(ws));
@@ -597,11 +597,11 @@ svr4_term_ioctl(fp, p, retval, fd, cmd, data)
if ((error = copyin(data, &ws, sizeof(ws))) != 0)
return error;
- return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws, p);
+ return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws, td);
}
default:
DPRINTF(("teleport to STREAMS ioctls...\n"));
- return svr4_stream_ti_ioctl(fp, p, retval, fd, cmd, data);
+ return svr4_stream_ti_ioctl(fp, td, retval, fd, cmd, data);
}
}
diff --git a/sys/compat/svr4/svr4_ttold.c b/sys/compat/svr4/svr4_ttold.c
index e139016..90cdae1 100644
--- a/sys/compat/svr4/svr4_ttold.c
+++ b/sys/compat/svr4/svr4_ttold.c
@@ -175,9 +175,9 @@ bsd_ltchars_to_svr4_ltchars(bl, sl)
int
-svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
+svr4_ttold_ioctl(fp, td, retval, fd, cmd, data)
struct file *fp;
- struct proc *p;
+ struct thread *td;
register_t *retval;
int fd;
u_long cmd;
@@ -192,7 +192,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
{
pid_t pid;
- if ((error = fo_ioctl(fp, TIOCGPGRP, (caddr_t) &pid, p)) != 0)
+ if ((error = fo_ioctl(fp, TIOCGPGRP, (caddr_t) &pid, td)) != 0)
return error;
DPRINTF(("TIOCGPGRP %d\n", pid));
@@ -211,21 +211,21 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
DPRINTF(("TIOCSPGRP %d\n", pid));
- return fo_ioctl(fp, TIOCSPGRP, (caddr_t) &pid, p);
+ return fo_ioctl(fp, TIOCSPGRP, (caddr_t) &pid, td);
}
case SVR4_TIOCGSID:
{
#if defined(TIOCGSID)
pid_t pid;
- if ((error = fo_ioctl(fp, TIOCGSID, (caddr_t) &pid, p)) != 0)
+ if ((error = fo_ioctl(fp, TIOCGSID, (caddr_t) &pid, td)) != 0)
return error;
DPRINTF(("TIOCGSID %d\n", pid));
return copyout(&pid, data, sizeof(pid));
#else
- uprintf("ioctl(TIOCGSID) for pid %d unsupported\n", p->p_pid);
+ uprintf("ioctl(TIOCGSID) for pid %d unsupported\n", td->td_proc->p_pid);
return EINVAL;
#endif
}
@@ -235,7 +235,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
struct sgttyb bs;
struct svr4_sgttyb ss;
- error = fo_ioctl(fp, TIOCGETP, (caddr_t) &bs, p);
+ error = fo_ioctl(fp, TIOCGETP, (caddr_t) &bs, td);
if (error)
return error;
@@ -260,7 +260,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
print_svr4_sgttyb("SVR4_TIOCSET{P,N}", &ss);
#endif /* DEBUG_SVR4 */
cmd = (cmd == SVR4_TIOCSETP) ? TIOCSETP : TIOCSETN;
- return fo_ioctl(fp, cmd, (caddr_t) &bs, p);
+ return fo_ioctl(fp, cmd, (caddr_t) &bs, td);
}
case SVR4_TIOCGETC:
@@ -268,7 +268,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
struct tchars bt;
struct svr4_tchars st;
- error = fo_ioctl(fp, TIOCGETC, (caddr_t) &bt, p);
+ error = fo_ioctl(fp, TIOCGETC, (caddr_t) &bt, td);
if (error)
return error;
@@ -291,7 +291,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
#ifdef DEBUG_SVR4
print_svr4_tchars("SVR4_TIOCSETC", &st);
#endif /* DEBUG_SVR4 */
- return fo_ioctl(fp, TIOCSETC, (caddr_t) &bt, p);
+ return fo_ioctl(fp, TIOCSETC, (caddr_t) &bt, td);
}
case SVR4_TIOCGLTC:
@@ -299,7 +299,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
struct ltchars bl;
struct svr4_ltchars sl;
- error = fo_ioctl(fp, TIOCGLTC, (caddr_t) &bl, p);
+ error = fo_ioctl(fp, TIOCGLTC, (caddr_t) &bl, td);
if (error)
return error;
@@ -322,13 +322,13 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
#ifdef DEBUG_SVR4
print_svr4_ltchars("SVR4_TIOCSLTC", &sl);
#endif /* DEBUG_SVR4 */
- return fo_ioctl(fp, TIOCSLTC, (caddr_t) &bl, p);
+ return fo_ioctl(fp, TIOCSLTC, (caddr_t) &bl, td);
}
case SVR4_TIOCLGET:
{
int flags;
- if ((error = fo_ioctl(fp, TIOCLGET, (caddr_t) &flags, p)) != 0)
+ if ((error = fo_ioctl(fp, TIOCLGET, (caddr_t) &flags, td)) != 0)
return error;
DPRINTF(("SVR4_TIOCLGET %o\n", flags));
return copyout(&flags, data, sizeof(flags));
@@ -356,7 +356,7 @@ svr4_ttold_ioctl(fp, p, retval, fd, cmd, data)
}
DPRINTF(("SVR4_TIOCL{SET,BIS,BIC} %o\n", flags));
- return fo_ioctl(fp, cmd, (caddr_t) &flags, p);
+ return fo_ioctl(fp, cmd, (caddr_t) &flags, td);
}
default:
diff --git a/sys/compat/svr4/svr4_util.h b/sys/compat/svr4/svr4_util.h
index 629edd6..9429c0f 100644
--- a/sys/compat/svr4/svr4_util.h
+++ b/sys/compat/svr4/svr4_util.h
@@ -53,7 +53,7 @@ static __inline void *stackgap_alloc(caddr_t *, size_t);
static __inline caddr_t
stackgap_init()
{
-#define szsigcode (*(curproc->p_sysent->sv_szsigcode))
+#define szsigcode (*(curthread->td_proc->p_sysent->sv_szsigcode))
return (caddr_t)(((caddr_t)PS_STRINGS) - szsigcode - SPARE_USRSPACE);
}
@@ -68,7 +68,7 @@ stackgap_alloc(sgp, sz)
}
extern const char svr4_emul_path[];
-int svr4_emul_find __P((struct proc *, caddr_t *, const char *, char *,
+int svr4_emul_find __P((struct thread *, caddr_t *, const char *, char *,
char **, int));
#define CHECKALT(p, sgp, path, i) \
OpenPOWER on IntegriCloud