summaryrefslogtreecommitdiffstats
path: root/sys/amd64/ia32/ia32_misc.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-10-09 22:27:24 +0000
committerpeter <peter@FreeBSD.org>2002-10-09 22:27:24 +0000
commit54a5ebbeb2fa30d25ba9c223aaa5542f9abd4f59 (patch)
tree6e5e5724e2c917c59122ced27e7bfabd37cb5598 /sys/amd64/ia32/ia32_misc.c
parentce8274a36c4a3728c7c015d4a50332f9f9f274c9 (diff)
downloadFreeBSD-src-54a5ebbeb2fa30d25ba9c223aaa5542f9abd4f59.zip
FreeBSD-src-54a5ebbeb2fa30d25ba9c223aaa5542f9abd4f59.tar.gz
Try and deal with the #ifdef COMPAT_FREEBSD4 sendfile stuff. This would
have been a lot easier if do_sendfile() was usable externally.
Diffstat (limited to 'sys/amd64/ia32/ia32_misc.c')
-rw-r--r--sys/amd64/ia32/ia32_misc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/amd64/ia32/ia32_misc.c b/sys/amd64/ia32/ia32_misc.c
index 8b28bce..b5dc006 100644
--- a/sys/amd64/ia32/ia32_misc.c
+++ b/sys/amd64/ia32/ia32_misc.c
@@ -26,6 +26,8 @@
* $FreeBSD$
*/
+#include "opt_compat.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@@ -1080,6 +1082,25 @@ ia32_ftruncate(struct thread *td, struct ia32_ftruncate_args *uap)
return (ftruncate(td, &ap));
}
+#ifdef COMPAT_FREEBSD4
+int
+freebsd4_ia32_sendfile(struct thread *td,
+ struct freebsd4_ia32_sendfile_args *uap)
+{
+ struct freebsd4_sendfile_args ap;
+
+ SCARG(&ap, fd) = SCARG(uap, fd);
+ SCARG(&ap, s) = SCARG(uap, s);
+ SCARG(&ap, offset) = (SCARG(uap, offsetlo)
+ | ((off_t)SCARG(uap, offsethi) << 32));
+ SCARG(&ap, nbytes) = SCARG(uap, nbytes); /* XXX check */
+ SCARG(&ap, hdtr) = SCARG(uap, hdtr); /* XXX check */
+ SCARG(&ap, sbytes) = SCARG(uap, sbytes); /* XXX FIXME!! */
+ SCARG(&ap, flags) = SCARG(uap, flags);
+ return (freebsd4_sendfile(td, &ap));
+}
+#endif
+
int
ia32_sendfile(struct thread *td, struct ia32_sendfile_args *uap)
{
OpenPOWER on IntegriCloud