summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-09-15 15:09:35 +0000
committered <ed@FreeBSD.org>2008-09-15 15:09:35 +0000
commit98f8e6b0ee14979edff117860d87a0511ebdb11f (patch)
tree8701bfd7aa50e5ddc7e68678a3e539f52e78215f
parent992112e8aae569900b58bbed8aca40e7692250c3 (diff)
downloadFreeBSD-src-98f8e6b0ee14979edff117860d87a0511ebdb11f.zip
FreeBSD-src-98f8e6b0ee14979edff117860d87a0511ebdb11f.tar.gz
Allow COMPAT_SVR4 to be built without COMPAT_43.
It seems we only depend on COMPAT_43 to implement the send() and recv() routines. We can easily implement them using sendto() and recvfrom(), just like we do inside our very own C library. I wasn't able to really test it, apart from simple compilation testing. I've heard rumours that COMPAT_SVR4 is broken inside execve() anyway. It's still worth to fix this, because I suspect we'll get rid of COMPAT_43 somewhere in the future... Reviewed by: rdivacky Discussed with: jhb
-rw-r--r--sys/compat/svr4/svr4_stream.c32
-rw-r--r--sys/compat/svr4/svr4_sysvec.c4
-rw-r--r--sys/modules/svr4/Makefile7
3 files changed, 21 insertions, 22 deletions
diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c
index ddf082b..68abf58 100644
--- a/sys/compat/svr4/svr4_stream.c
+++ b/sys/compat/svr4/svr4_stream.c
@@ -1985,24 +1985,32 @@ int svr4_sys_send(td, uap)
struct thread *td;
struct svr4_sys_send_args *uap;
{
- struct osend_args osa;
- osa.s = uap->s;
- osa.buf = uap->buf;
- osa.len = uap->len;
- osa.flags = uap->flags;
- return osend(td, &osa);
+ struct sendto_args sta;
+
+ sta.s = uap->s;
+ sta.buf = uap->buf;
+ sta.len = uap->len;
+ sta.flags = uap->flags;
+ sta.to = NULL;
+ sta.tolen = 0;
+
+ return (sendto(td, &sta));
}
int svr4_sys_recv(td, uap)
struct thread *td;
struct svr4_sys_recv_args *uap;
{
- struct orecv_args ora;
- ora.s = uap->s;
- ora.buf = uap->buf;
- ora.len = uap->len;
- ora.flags = uap->flags;
- return orecv(td, &ora);
+ struct recvfrom_args rfa;
+
+ rfa.s = uap->s;
+ rfa.buf = uap->buf;
+ rfa.len = uap->len;
+ rfa.flags = uap->flags;
+ rfa.from = NULL;
+ rfa.fromlenaddr = NULL;
+
+ return (recvfrom(td, &rfa));
}
/*
diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c
index d8c1974..8d019d2 100644
--- a/sys/compat/svr4/svr4_sysvec.c
+++ b/sys/compat/svr4/svr4_sysvec.c
@@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$");
/* XXX we use functions that might not exist. */
#include "opt_compat.h"
-#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>
diff --git a/sys/modules/svr4/Makefile b/sys/modules/svr4/Makefile
index 6229ec9..447d048 100644
--- a/sys/modules/svr4/Makefile
+++ b/sys/modules/svr4/Makefile
@@ -24,14 +24,9 @@ svr4_locore.o: svr4_locore.s svr4_assym.h
svr4_genassym.o: svr4_genassym.c svr4.h @ machine
${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
-.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
.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud