diff options
author | ed <ed@FreeBSD.org> | 2008-09-15 15:09:35 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2008-09-15 15:09:35 +0000 |
commit | 98f8e6b0ee14979edff117860d87a0511ebdb11f (patch) | |
tree | 8701bfd7aa50e5ddc7e68678a3e539f52e78215f /sys/compat | |
parent | 992112e8aae569900b58bbed8aca40e7692250c3 (diff) | |
download | FreeBSD-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
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/svr4/svr4_stream.c | 32 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_sysvec.c | 4 |
2 files changed, 20 insertions, 16 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> |