From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 14 15:49:31 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A69F106567C for ; Sun, 14 Sep 2008 15:49:31 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [87.251.61.211]) by mx1.freebsd.org (Postfix) with ESMTP id AAF4D8FC0C for ; Sun, 14 Sep 2008 15:49:30 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id E34EE1CC22; Sun, 14 Sep 2008 17:38:40 +0200 (CEST) Date: Sun, 14 Sep 2008 17:38:40 +0200 From: Ed Schouten To: freebsd-emulation@freebsd.org Message-ID: <20080914153840.GO1191@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BouVgDkIlpb7X6Bk" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Subject: [Patch] Compiling COMPAT_SVR4 without COMPAT_43 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 15:49:31 -0000 --BouVgDkIlpb7X6Bk Content-Type: multipart/mixed; boundary="G+DT6X5ssgZ56VG3" Content-Disposition: inline --G+DT6X5ssgZ56VG3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello everyone, I just build this patch on my system at home. Fortunately I'm not a user of COMPAT_SVR4, but I thought some of its users may actually find it useful. The attached patch should allow COMPAT_SVR4 users to use it without having COMPAT_43 in their kernel configuration. Any comments? I'll commit it when (if) I've received any feedback. Thanks! --=20 Ed Schouten WWW: http://80386.nl/ --G+DT6X5ssgZ56VG3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="svr4.diff" Content-Transfer-Encoding: quoted-printable Index: sys/compat/svr4/svr4_stream.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/compat/svr4/svr4_stream.c (revision 182995) +++ sys/compat/svr4/svr4_stream.c (working copy) @@ -1985,24 +1985,32 @@ struct thread *td; struct svr4_sys_send_args *uap; { - struct osend_args osa; - osa.s =3D uap->s; - osa.buf =3D uap->buf; - osa.len =3D uap->len; - osa.flags =3D uap->flags; - return osend(td, &osa); + struct sendto_args sta; + + sta.s =3D uap->s; + sta.buf =3D uap->buf; + sta.len =3D uap->len; + sta.flags =3D uap->flags; + sta.to =3D NULL; + sta.tolen =3D 0; + + return (sendto(td, &sta)); } =20 int svr4_sys_recv(td, uap) struct thread *td; struct svr4_sys_recv_args *uap; { - struct orecv_args ora; - ora.s =3D uap->s; - ora.buf =3D uap->buf; - ora.len =3D uap->len; - ora.flags =3D uap->flags; - return orecv(td, &ora); + struct recvfrom_args rfa; + + rfa.s =3D uap->s; + rfa.buf =3D uap->buf; + rfa.len =3D uap->len; + rfa.flags =3D uap->flags; + rfa.from =3D NULL; + rfa.fromlenaddr =3D NULL; + + return (recvfrom(td, &rfa)); } =20 /*=20 Index: sys/compat/svr4/svr4_sysvec.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/compat/svr4/svr4_sysvec.c (revision 182995) +++ sys/compat/svr4/svr4_sysvec.c (working copy) @@ -34,10 +34,6 @@ /* XXX we use functions that might not exist. */ #include "opt_compat.h" =20 -#ifndef COMPAT_43 -#error "Unable to compile SVR4-emulator due to missing COMPAT_43 option!" -#endif - #include #include #include Index: sys/modules/svr4/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/modules/svr4/Makefile (revision 182995) +++ sys/modules/svr4/Makefile (working copy) @@ -24,14 +24,9 @@ svr4_genassym.o: svr4_genassym.c svr4.h @ machine ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC} =20 -.if !defined(KERNBUILDDIR) -opt_compat.h: - echo "#define COMPAT_43 1" > ${.TARGET} - -.if defined(DEBUG) +.if !defined(KERNBUILDDIR) && defined(DEBUG) opt_svr4.h: echo "#define DEBUG_SVR4 1" > ${.TARGET} .endif -.endif =20 .include --G+DT6X5ssgZ56VG3-- --BouVgDkIlpb7X6Bk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjNMAAACgkQ52SDGA2eCwV0KwCePpJO/B76CX6xwg9ZY/ZxUwjD zPYAnixg5M12LlroplrAQkEUqS6hzB5X =LDWq -----END PGP SIGNATURE----- --BouVgDkIlpb7X6Bk--