Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nathanw_sa]: src/sys/compat/svr4 pass lwp to _ioctl functions.



details:   https://anonhg.NetBSD.org/src/rev/33c354cd5e50
branches:  nathanw_sa
changeset: 506171:33c354cd5e50
user:      petrov <petrov%NetBSD.org@localhost>
date:      Fri Aug 23 02:40:50 2002 +0000

description:
pass lwp to _ioctl functions.

diffstat:

 sys/compat/svr4/svr4_filio.c   |    9 +-
 sys/compat/svr4/svr4_ioctl.c   |    8 +-
 sys/compat/svr4/svr4_ioctl.h   |   14 +-
 sys/compat/svr4/svr4_sockio.c  |    9 +-
 sys/compat/svr4/svr4_stream.c  |  206 +++++++++++++++++++---------------------
 sys/compat/svr4/svr4_termios.c |   11 +-
 sys/compat/svr4/svr4_ttold.c   |    9 +-
 7 files changed, 131 insertions(+), 135 deletions(-)

diffs (truncated from 834 to 300 lines):

diff -r 00ffb3ebe967 -r 33c354cd5e50 sys/compat/svr4/svr4_filio.c
--- a/sys/compat/svr4/svr4_filio.c      Fri Aug 23 02:38:35 2002 +0000
+++ b/sys/compat/svr4/svr4_filio.c      Fri Aug 23 02:40:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_filio.c,v 1.7.14.2 2002/05/29 21:32:59 nathanw Exp $       */
+/*     $NetBSD: svr4_filio.c,v 1.7.14.3 2002/08/23 02:40:50 petrov Exp $        */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_filio.c,v 1.7.14.2 2002/05/29 21:32:59 nathanw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_filio.c,v 1.7.14.3 2002/08/23 02:40:50 petrov Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -68,14 +68,15 @@
 
 
 int
-svr4_fil_ioctl(fp, p, retval, fd, cmd, data)
+svr4_fil_ioctl(fp, l, retval, fd, cmd, data)
        struct file *fp;
-       struct proc *p;
+       struct lwp *l;
        register_t *retval;
        int fd;
        u_long cmd;
        caddr_t data;
 {
+       struct proc *p = l->l_proc;
        int error;
        int num;
        struct filedesc *fdp = p->p_fd;
diff -r 00ffb3ebe967 -r 33c354cd5e50 sys/compat/svr4/svr4_ioctl.c
--- a/sys/compat/svr4/svr4_ioctl.c      Fri Aug 23 02:38:35 2002 +0000
+++ b/sys/compat/svr4/svr4_ioctl.c      Fri Aug 23 02:40:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_ioctl.c,v 1.20.6.5 2002/07/12 01:40:04 nathanw Exp $       */
+/*     $NetBSD: svr4_ioctl.c,v 1.20.6.6 2002/08/23 02:40:51 petrov Exp $        */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_ioctl.c,v 1.20.6.5 2002/07/12 01:40:04 nathanw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_ioctl.c,v 1.20.6.6 2002/08/23 02:40:51 petrov Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -108,7 +108,7 @@
        struct file     *fp;
        struct filedesc *fdp;
        u_long           cmd;
-       int (*fun) __P((struct file *, struct proc *, register_t *,
+       int (*fun) __P((struct file *, struct lwp *, register_t *,
                        int, u_long, caddr_t));
 #ifdef DEBUG_SVR4
        char             dir[4];
@@ -159,5 +159,5 @@
                DPRINTF(("Unimplemented ioctl %lx\n", cmd));
                return 0;       /* XXX: really ENOSYS */
        }
-       return (*fun)(fp, p, retval, SCARG(uap, fd), cmd, SCARG(uap, data));
+       return (*fun)(fp, l, retval, SCARG(uap, fd), cmd, SCARG(uap, data));
 }
diff -r 00ffb3ebe967 -r 33c354cd5e50 sys/compat/svr4/svr4_ioctl.h
--- a/sys/compat/svr4/svr4_ioctl.h      Fri Aug 23 02:38:35 2002 +0000
+++ b/sys/compat/svr4/svr4_ioctl.h      Fri Aug 23 02:40:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_ioctl.h,v 1.7 1998/09/04 19:54:38 christos Exp $   */
+/*     $NetBSD: svr4_ioctl.h,v 1.7.24.1 2002/08/23 02:40:51 petrov Exp $        */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -54,17 +54,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 lwp *, 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 lwp *, 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 lwp *, 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 lwp *, 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 lwp *, 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 lwp *, register_t *,
                                  int, u_long, caddr_t));
 
 #endif /* !_SVR4_IOCTL_H_ */
diff -r 00ffb3ebe967 -r 33c354cd5e50 sys/compat/svr4/svr4_sockio.c
--- a/sys/compat/svr4/svr4_sockio.c     Fri Aug 23 02:38:35 2002 +0000
+++ b/sys/compat/svr4/svr4_sockio.c     Fri Aug 23 02:40:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_sockio.c,v 1.13.6.2 2002/05/29 21:33:01 nathanw Exp $      */
+/*     $NetBSD: svr4_sockio.c,v 1.13.6.3 2002/08/23 02:40:51 petrov Exp $       */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_sockio.c,v 1.13.6.2 2002/05/29 21:33:01 nathanw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_sockio.c,v 1.13.6.3 2002/08/23 02:40:51 petrov Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -91,14 +91,15 @@
 }
 
 int
-svr4_sock_ioctl(fp, p, retval, fd, cmd, data)
+svr4_sock_ioctl(fp, l, retval, fd, cmd, data)
        struct file *fp;
-       struct proc *p;
+       struct lwp *l;
        register_t *retval;
        int fd;
        u_long cmd;
        caddr_t data;
 {
+       struct proc *p = l->l_proc;
        int error;
        int (*ctl) __P((struct file *, u_long,  caddr_t, struct proc *)) =
                        fp->f_ops->fo_ioctl;
diff -r 00ffb3ebe967 -r 33c354cd5e50 sys/compat/svr4/svr4_stream.c
--- a/sys/compat/svr4/svr4_stream.c     Fri Aug 23 02:38:35 2002 +0000
+++ b/sys/compat/svr4/svr4_stream.c     Fri Aug 23 02:40:50 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_stream.c,v 1.41.2.7 2002/06/24 22:09:39 nathanw Exp $      */
+/*     $NetBSD: svr4_stream.c,v 1.41.2.8 2002/08/23 02:40:51 petrov Exp $       */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.41.2.7 2002/06/24 22:09:39 nathanw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.41.2.8 2002/08/23 02:40:51 petrov Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -84,7 +84,7 @@
 
 
 /* Utils */
-static int clean_pipe __P((struct proc *, const char *));
+static int clean_pipe __P((struct lwp *, const char *));
 static void getparm __P((struct file *, struct svr4_si_sockparms *));
 
 /* Address Conversions */
@@ -98,42 +98,42 @@
                                        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 lwp *, register_t *, int,
     u_long, caddr_t));
-static int i_fdinsert __P((struct file *, struct proc *, register_t *, int,
+static int i_fdinsert __P((struct file *, struct lwp *, register_t *, int,
     u_long, caddr_t));
-static int i_str __P((struct file *, struct proc *, register_t *, int,
+static int i_str __P((struct file *, struct lwp *, register_t *, int,
     u_long, caddr_t));
-static int i_setsig __P((struct file *, struct proc *, register_t *, int,
+static int i_setsig __P((struct file *, struct lwp *, register_t *, int,
     u_long, caddr_t));
-static int i_getsig __P((struct file *, struct proc *, register_t *, int,
+static int i_getsig __P((struct file *, struct lwp *, register_t *, int,
     u_long, caddr_t));
-static int _i_bind_rsvd __P((struct file *, struct proc *, register_t *, int,
+static int _i_bind_rsvd __P((struct file *, struct lwp *, register_t *, int,
     u_long, caddr_t));
-static int _i_rele_rsvd __P((struct file *, struct proc *, register_t *, int,
+static int _i_rele_rsvd __P((struct file *, struct lwp *, register_t *, int,
     u_long, caddr_t));
 
 /* i_str sockmod calls */
 static int sockmod       __P((struct file *, int, struct svr4_strioctl *,
-                             struct proc *));
+                             struct lwp *));
 static int si_listen     __P((struct file *, int, struct svr4_strioctl *,
-                             struct proc *));
+                             struct lwp *));
 static int si_ogetudata  __P((struct file *, int, struct svr4_strioctl *,
-                             struct proc *));
+                             struct lwp *));
 static int si_sockparams __P((struct file *, int, struct svr4_strioctl *,
-                             struct proc *));
+                             struct lwp *));
 static int si_shutdown  __P((struct file *, int, struct svr4_strioctl *,
-                             struct proc *));
+                             struct lwp *));
 static int si_getudata   __P((struct file *, int, struct svr4_strioctl *,
-                             struct proc *));
+                             struct lwp *));
 
 /* i_str timod calls */
 static int timod         __P((struct file *, int, struct svr4_strioctl *,
-                             struct proc *));
+                             struct lwp *));
 static int ti_getinfo    __P((struct file *, int, struct svr4_strioctl *,
-                             struct proc *));
+                             struct lwp *));
 static int ti_bind       __P((struct file *, int, struct svr4_strioctl *,
-                             struct proc *));
+                             struct lwp *));
 
 #ifdef DEBUG_SVR4
 static void bufprint __P((u_char *, size_t));
@@ -274,29 +274,29 @@
  * to avoid code duplication.
  */
 static int
-clean_pipe(p, path)
-       struct proc *p;
+clean_pipe(l, path)
+       struct lwp *l;
        const char *path;
 {
+       struct proc *p = l->l_proc;
        struct sys___lstat13_args la;
        struct sys_unlink_args ua;
        register_t retval;
        struct stat st;
        int error;
        caddr_t sg = stackgap_init(p, 0);
-       size_t l = strlen(path) + 1;
+       size_t len = strlen(path) + 1;
        void *tpath;
 
-       tpath = stackgap_alloc(p, &sg, l);
+       tpath = stackgap_alloc(p, &sg, len);
        SCARG(&la, ub) = stackgap_alloc(p, &sg, sizeof(struct stat));
 
-       if ((error = copyout(path, tpath, l)) != 0)
+       if ((error = copyout(path, tpath, len)) != 0)
                return error;
 
        SCARG(&la, path) = tpath;
 
-       /* XXX NJWLWP */
-       if ((error = sys___lstat13(curlwp, &la, &retval)) != 0)
+       if ((error = sys___lstat13(l, &la, &retval)) != 0)
                return 0;
 
        if ((error = copyin(SCARG(&la, ub), &st, sizeof(st))) != 0)
@@ -314,8 +314,7 @@
 
        SCARG(&ua, path) = SCARG(&la, path);
 
-       /* XXX NJWLWP */
-       if ((error = sys_unlink(curlwp, &ua, &retval)) != 0) {
+       if ((error = sys_unlink(l, &ua, &retval)) != 0) {
                DPRINTF(("clean_pipe: unlink failed %d\n", error));
                return error;
        }
@@ -441,11 +440,11 @@
 
 
 static int
-si_ogetudata(fp, fd, ioc, p)
+si_ogetudata(fp, fd, ioc, l)
        struct file             *fp;
        int                      fd;
        struct svr4_strioctl    *ioc;
-       struct proc             *p;
+       struct lwp              *l;
 {
        int error;
        struct svr4_si_oudata ud;
@@ -498,11 +497,11 @@
 
 
 static int
-si_sockparams(fp, fd, ioc, p)
+si_sockparams(fp, fd, ioc, l)
        struct file             *fp;
        int                      fd;
        struct svr4_strioctl    *ioc;
-       struct proc             *p;
+       struct lwp              *l;
 {
        struct svr4_si_sockparms pa;
 



Home | Main Index | Thread Index | Old Index