From 54a5ebbeb2fa30d25ba9c223aaa5542f9abd4f59 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 9 Oct 2002 22:27:24 +0000 Subject: Try and deal with the #ifdef COMPAT_FREEBSD4 sendfile stuff. This would have been a lot easier if do_sendfile() was usable externally. --- sys/compat/freebsd32/freebsd32_misc.c | 21 +++++++++++++++++++++ sys/compat/freebsd32/syscalls.master | 6 ++++-- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'sys/compat') diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 8b28bce..b5dc006 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include "opt_compat.h" + #include #include #include @@ -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) { diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index 3010aa5..09813b5 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -475,7 +475,7 @@ 334 MNOPROTO POSIX { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } 335 NOPROTO BSD { int utrace(const void *addr, size_t len); } ; XXX note - bigendian is different -336 MSTD BSD { int ia32_sendfile(int fd, int s, u_int32_t offsetlo, \ +336 MCOMPAT4 BSD { int ia32_osendfile(int fd, int s, u_int32_t offsetlo,\ u_int32_t offsethi, size_t nbytes, \ struct sf_hdtr *hdtr, off_t *sbytes, int flags); } 337 NOPROTO BSD { int kldsym(int fileid, int cmd, void *data); } @@ -561,7 +561,9 @@ int len); } 391 NOPROTO BSD { int lchflags(const char *path, int flags); } 392 NOPROTO BSD { int uuidgen(struct uuid *store, int count); } -393 UNIMPL NOHIDE nsendfile +393 MSTD BSD { int ia32_sendfile(int fd, int s, u_int32_t offsetlo, \ + u_int32_t offsethi, size_t nbytes, \ + struct sf_hdtr *hdtr, off_t *sbytes, int flags); } 394 UNIMPL NOHIDE mac_syscall 395 UNIMPL NOHIDE nosys 396 UNIMPL NOHIDE nosys -- cgit v1.1