diff options
author | peter <peter@FreeBSD.org> | 2002-10-09 22:27:24 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-10-09 22:27:24 +0000 |
commit | 54a5ebbeb2fa30d25ba9c223aaa5542f9abd4f59 (patch) | |
tree | 6e5e5724e2c917c59122ced27e7bfabd37cb5598 /sys/ia64/ia32 | |
parent | ce8274a36c4a3728c7c015d4a50332f9f9f274c9 (diff) | |
download | FreeBSD-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/ia64/ia32')
-rw-r--r-- | sys/ia64/ia32/ia32_misc.c | 21 | ||||
-rw-r--r-- | sys/ia64/ia32/syscalls.master | 6 |
2 files changed, 25 insertions, 2 deletions
diff --git a/sys/ia64/ia32/ia32_misc.c b/sys/ia64/ia32/ia32_misc.c index 8b28bce..b5dc006 100644 --- a/sys/ia64/ia32/ia32_misc.c +++ b/sys/ia64/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) { diff --git a/sys/ia64/ia32/syscalls.master b/sys/ia64/ia32/syscalls.master index 3010aa5..09813b5 100644 --- a/sys/ia64/ia32/syscalls.master +++ b/sys/ia64/ia32/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 |