Date: Tue, 1 Sep 2020 12:09:13 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365034 - in stable/12/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux Message-ID: <202009011209.081C9DlF076785@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Tue Sep 1 12:09:13 2020 New Revision: 365034 URL: https://svnweb.freebsd.org/changeset/base/365034 Log: MFC r363304: Add a trivial linux(4) splice(2) implementation, which simply returns EINVAL. Fixes grep (grep-3.1-2build1). PR: 218699 Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/amd64/linux/linux_dummy.c stable/12/sys/amd64/linux/syscalls.master stable/12/sys/amd64/linux32/linux32_dummy.c stable/12/sys/amd64/linux32/syscalls.master stable/12/sys/arm64/linux/linux_dummy.c stable/12/sys/arm64/linux/syscalls.master stable/12/sys/compat/linux/linux_file.c stable/12/sys/i386/linux/linux_dummy.c stable/12/sys/i386/linux/syscalls.master Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/12/sys/amd64/linux/linux_dummy.c Tue Sep 1 11:34:05 2020 (r365033) +++ stable/12/sys/amd64/linux/linux_dummy.c Tue Sep 1 12:09:13 2020 (r365034) @@ -106,7 +106,6 @@ DUMMY(inotify_rm_watch); DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ -DUMMY(splice); DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ Modified: stable/12/sys/amd64/linux/syscalls.master ============================================================================== --- stable/12/sys/amd64/linux/syscalls.master Tue Sep 1 11:34:05 2020 (r365033) +++ stable/12/sys/amd64/linux/syscalls.master Tue Sep 1 12:09:13 2020 (r365034) @@ -465,7 +465,8 @@ l_size_t len); } 274 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ struct linux_robust_list_head **head, l_size_t *len); } -275 AUE_NULL STD { int linux_splice(void); } +275 AUE_NULL STD { int linux_splice(int fd_in, l_loff_t *off_in, \ + int fd_out, l_loff_t *off_out, l_size_t len, l_uint flags); } 276 AUE_NULL STD { int linux_tee(void); } 277 AUE_NULL STD { int linux_sync_file_range(l_int fd, l_loff_t offset, l_loff_t nbytes, unsigned int flags); } Modified: stable/12/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_dummy.c Tue Sep 1 11:34:05 2020 (r365033) +++ stable/12/sys/amd64/linux32/linux32_dummy.c Tue Sep 1 12:09:13 2020 (r365034) @@ -103,7 +103,6 @@ DUMMY(inotify_rm_watch); DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ -DUMMY(splice); DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ Modified: stable/12/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/12/sys/amd64/linux32/syscalls.master Tue Sep 1 11:34:05 2020 (r365033) +++ stable/12/sys/amd64/linux32/syscalls.master Tue Sep 1 12:09:13 2020 (r365034) @@ -524,7 +524,8 @@ l_size_t len); } 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ struct linux_robust_list_head **head, l_size_t *len); } -313 AUE_NULL STD { int linux_splice(void); } +313 AUE_NULL STD { int linux_splice(int fd_in, l_loff_t *off_in, \ + int fd_out, l_loff_t *off_out, l_size_t len, l_uint flags); } 314 AUE_NULL STD { int linux_sync_file_range(l_int fd, uint32_t offset1, uint32_t offset2, uint32_t nbytes1, uint32_t nbytes2, unsigned int flags); } Modified: stable/12/sys/arm64/linux/linux_dummy.c ============================================================================== --- stable/12/sys/arm64/linux/linux_dummy.c Tue Sep 1 11:34:05 2020 (r365033) +++ stable/12/sys/arm64/linux/linux_dummy.c Tue Sep 1 12:09:13 2020 (r365034) @@ -99,7 +99,6 @@ DUMMY(inotify_rm_watch); DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ -DUMMY(splice); DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ Modified: stable/12/sys/arm64/linux/syscalls.master ============================================================================== --- stable/12/sys/arm64/linux/syscalls.master Tue Sep 1 11:34:05 2020 (r365033) +++ stable/12/sys/arm64/linux/syscalls.master Tue Sep 1 12:09:13 2020 (r365034) @@ -413,7 +413,14 @@ int linux_vmsplice(void); } 76 AUE_NULL STD { - int linux_splice(void); + int linux_splice( + int fd_in, + l_loff_t *off_in, + int fd_out, + l_loff_t *off_out, + l_size_t len, + l_uint flags + ); } 77 AUE_NULL STD { int linux_tee(void); Modified: stable/12/sys/compat/linux/linux_file.c ============================================================================== --- stable/12/sys/compat/linux/linux_file.c Tue Sep 1 11:34:05 2020 (r365033) +++ stable/12/sys/compat/linux/linux_file.c Tue Sep 1 12:09:13 2020 (r365034) @@ -1618,3 +1618,17 @@ linux_fallocate(struct thread *td, struct linux_falloc return (kern_posix_fallocate(td, args->fd, offset, len)); } + +int +linux_splice(struct thread *td, struct linux_splice_args *args) +{ + + linux_msg(td, "syscall splice not really implemented"); + + /* + * splice(2) is documented to return EINVAL in various circumstances; + * returning it instead of ENOSYS should hint the caller to use fallback + * instead. + */ + return (EINVAL); +} Modified: stable/12/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/12/sys/i386/linux/linux_dummy.c Tue Sep 1 11:34:05 2020 (r365033) +++ stable/12/sys/i386/linux/linux_dummy.c Tue Sep 1 12:09:13 2020 (r365034) @@ -99,7 +99,6 @@ DUMMY(inotify_rm_watch); DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ -DUMMY(splice); DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ Modified: stable/12/sys/i386/linux/syscalls.master ============================================================================== --- stable/12/sys/i386/linux/syscalls.master Tue Sep 1 11:34:05 2020 (r365033) +++ stable/12/sys/i386/linux/syscalls.master Tue Sep 1 12:09:13 2020 (r365034) @@ -532,7 +532,8 @@ l_size_t len); } 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ struct linux_robust_list_head **head, l_size_t *len); } -313 AUE_NULL STD { int linux_splice(void); } +313 AUE_NULL STD { int linux_splice(int fd_in, l_loff_t *off_in, \ + int fd_out, l_loff_t *off_out, l_size_t len, l_uint flags); } 314 AUE_NULL STD { int linux_sync_file_range(l_int fd, l_loff_t offset, l_loff_t nbytes, unsigned int flags); } 315 AUE_NULL STD { int linux_tee(void); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009011209.081C9DlF076785>