mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Try and deal with the #ifdef COMPAT_FREEBSD4 sendfile stuff. This would
have been a lot easier if do_sendfile() was usable externally.
This commit is contained in:
parent
cc7a6f19d0
commit
459e3a7a37
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104738
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user