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
This commit is contained in:
ed 2008-09-15 15:09:35 +00:00
parent 992112e8aa
commit 98f8e6b0ee
3 changed files with 21 additions and 22 deletions

View File

@ -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));
}
/*

View File

@ -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>

View File

@ -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>