Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/compat/svr4_32 Pull up revision 1.3 (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/05039cb1221e
branches:  netbsd-1-6
changeset: 528557:05039cb1221e
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Jul 22 14:53:18 2002 +0000

description:
Pull up revision 1.3 (requested by matt in ticket #537):
Make SVR4_32 work with the sparc32 version of setiathome.  This required
fixing the socket syscall and the SIOGIFCONF ioctl code.

diffstat:

 sys/compat/svr4_32/svr4_32_socket.c |  23 +++++++++++++++--------
 sys/compat/svr4_32/svr4_32_sockio.c |  16 ++++++++++------
 2 files changed, 25 insertions(+), 14 deletions(-)

diffs (116 lines):

diff -r 075688eb68cb -r 05039cb1221e sys/compat/svr4_32/svr4_32_socket.c
--- a/sys/compat/svr4_32/svr4_32_socket.c       Mon Jul 22 14:53:09 2002 +0000
+++ b/sys/compat/svr4_32/svr4_32_socket.c       Mon Jul 22 14:53:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_32_socket.c,v 1.2 2001/11/13 02:09:29 lukem Exp $ */
+/*     $NetBSD: svr4_32_socket.c,v 1.2.10.1 2002/07/22 14:53:18 lukem Exp $    */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.2 2001/11/13 02:09:29 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.2.10.1 2002/07/22 14:53:18 lukem Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -193,29 +193,36 @@
        register_t *retval;
 {
        struct svr4_32_sys_socket_args *uap = v;
+       struct sys_socket_args uap0;
 
+       /*
+        * We need to use a separate args since native has a different
+        * padding.
+        */
+       SCARG(&uap0, domain) = SCARG(uap, domain);
+       SCARG(&uap0, protocol) = SCARG(uap, protocol);
        switch (SCARG(uap, type)) {
        case SVR4_SOCK_DGRAM:
-               SCARG(uap, type) = SOCK_DGRAM;
+               SCARG(&uap0, type) = SOCK_DGRAM;
                break;
 
        case SVR4_SOCK_STREAM:
-               SCARG(uap, type) = SOCK_STREAM;
+               SCARG(&uap0, type) = SOCK_STREAM;
                break;
 
        case SVR4_SOCK_RAW:
-               SCARG(uap, type) = SOCK_RAW;
+               SCARG(&uap0, type) = SOCK_RAW;
                break;
 
        case SVR4_SOCK_RDM:
-               SCARG(uap, type) = SOCK_RDM;
+               SCARG(&uap0, type) = SOCK_RDM;
                break;
 
        case SVR4_SOCK_SEQPACKET:
-               SCARG(uap, type) = SOCK_SEQPACKET;
+               SCARG(&uap0, type) = SOCK_SEQPACKET;
                break;
        default:
                return EINVAL;
        }
-       return sys_socket(p, uap, retval);
+       return sys_socket(p, &uap0, retval);
 }
diff -r 075688eb68cb -r 05039cb1221e sys/compat/svr4_32/svr4_32_sockio.c
--- a/sys/compat/svr4_32/svr4_32_sockio.c       Mon Jul 22 14:53:09 2002 +0000
+++ b/sys/compat/svr4_32/svr4_32_sockio.c       Mon Jul 22 14:53:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_32_sockio.c,v 1.2 2001/11/13 02:09:30 lukem Exp $  */
+/*     $NetBSD: svr4_32_sockio.c,v 1.2.10.1 2002/07/22 14:53:27 lukem Exp $     */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.2 2001/11/13 02:09:30 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.2.10.1 2002/07/22 14:53:27 lukem Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -137,7 +137,7 @@
                        return copyout(&ifnum, data, sizeof(ifnum));
                }
 
-       case SVR4_SIOCGIFFLAGS:
+       case SVR4_32_SIOCGIFFLAGS:
                {
                        struct ifreq br;
                        struct svr4_32_ifreq sr;
@@ -161,9 +161,10 @@
                        return copyout(&sr, data, sizeof(sr));
                }
 
-       case SVR4_SIOCGIFCONF:
+       case SVR4_32_SIOCGIFCONF:
                {
                        struct svr4_32_ifconf sc;
+                       struct ifconf ifc;
 
                        if ((error = copyin(data, &sc, sizeof(sc))) != 0)
                                return error;
@@ -171,10 +172,13 @@
                        DPRINTF(("ifreq %ld svr4_32_ifreq %ld ifc_len %d\n",
                                (unsigned long)sizeof(struct ifreq),
                                (unsigned long)sizeof(struct svr4_32_ifreq),
-                               sc.svr4_ifc_len));
+                               sc.svr4_32_ifc_len));
+
+                       ifc.ifc_len = sc.svr4_32_ifc_len;
+                       ifc.ifc_buf = (caddr_t)(uintptr_t)sc.ifc_ifcu.ifcu_buf;
 
                        if ((error = (*ctl)(fp, OSIOCGIFCONF,
-                                           (caddr_t) &sc, p)) != 0)
+                                           (caddr_t) &ifc, p)) != 0)
                                return error;
 
                        DPRINTF(("SIOCGIFCONF\n"));



Home | Main Index | Thread Index | Old Index