Date: Sun, 14 Sep 2008 17:38:40 +0200 From: Ed Schouten <ed@80386.nl> To: freebsd-emulation@freebsd.org Subject: [Patch] Compiling COMPAT_SVR4 without COMPAT_43 Message-ID: <20080914153840.GO1191@hoeg.nl>
next in thread | raw e-mail | index | archive | help
--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 <ed@80386.nl> 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 <sys/param.h> #include <sys/systm.h> #include <sys/proc.h> 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 <bsd.kmod.mk> --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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080914153840.GO1191>