From owner-svn-src-stable-12@freebsd.org Tue Sep 1 12:09:15 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C510D3C5329; Tue, 1 Sep 2020 12:09:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bgm8C4pBpz4Q3y; Tue, 1 Sep 2020 12:09:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8805618A6C; Tue, 1 Sep 2020 12:09:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 081C9FHp076793; Tue, 1 Sep 2020 12:09:15 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 081C9DlF076785; Tue, 1 Sep 2020 12:09:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009011209.081C9DlF076785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 1 Sep 2020 12:09:13 +0000 (UTC) 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 X-SVN-Group: stable-12 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in stable/12/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 365034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2020 12:09:15 -0000 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); }