From owner-svn-src-head@freebsd.org Sat Jul 18 11:28:42 2020 Return-Path: Delivered-To: svn-src-head@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 C5542365F1A; Sat, 18 Jul 2020 11:28:42 +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 4B85NB3qYfz4994; Sat, 18 Jul 2020 11:28:42 +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 4E9009E6A; Sat, 18 Jul 2020 11:28:42 +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 06IBSgXK022513; Sat, 18 Jul 2020 11:28:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06IBSegr022504; Sat, 18 Jul 2020 11:28:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202007181128.06IBSegr022504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 18 Jul 2020 11:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363304 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 363304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jul 2020 11:28:42 -0000 Author: trasz Date: Sat Jul 18 11:28:40 2020 New Revision: 363304 URL: https://svnweb.freebsd.org/changeset/base/363304 Log: Add a trivial linux(4) splice(2) implementation, which simply returns EINVAL. Fixes grep (grep-3.1-2build1). PR: kern/218699 Reported by: avos Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25636 Modified: head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux/syscalls.master head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/syscalls.master head/sys/arm64/linux/linux_dummy.c head/sys/arm64/linux/syscalls.master head/sys/compat/linux/linux_file.c head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Sat Jul 18 10:56:04 2020 (r363303) +++ head/sys/amd64/linux/linux_dummy.c Sat Jul 18 11:28:40 2020 (r363304) @@ -105,7 +105,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: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Sat Jul 18 10:56:04 2020 (r363303) +++ head/sys/amd64/linux/syscalls.master Sat Jul 18 11:28:40 2020 (r363304) @@ -1612,7 +1612,14 @@ ); } 275 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 + ); } 276 AUE_NULL STD { int linux_tee(void); Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Sat Jul 18 10:56:04 2020 (r363303) +++ head/sys/amd64/linux32/linux32_dummy.c Sat Jul 18 11:28:40 2020 (r363304) @@ -102,7 +102,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: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sat Jul 18 10:56:04 2020 (r363303) +++ head/sys/amd64/linux32/syscalls.master Sat Jul 18 11:28:40 2020 (r363304) @@ -1731,7 +1731,14 @@ ); } 313 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 + ); } 314 AUE_NULL STD { int linux_sync_file_range( Modified: head/sys/arm64/linux/linux_dummy.c ============================================================================== --- head/sys/arm64/linux/linux_dummy.c Sat Jul 18 10:56:04 2020 (r363303) +++ head/sys/arm64/linux/linux_dummy.c Sat Jul 18 11:28:40 2020 (r363304) @@ -98,7 +98,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: head/sys/arm64/linux/syscalls.master ============================================================================== --- head/sys/arm64/linux/syscalls.master Sat Jul 18 10:56:04 2020 (r363303) +++ head/sys/arm64/linux/syscalls.master Sat Jul 18 11:28:40 2020 (r363304) @@ -467,7 +467,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: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sat Jul 18 10:56:04 2020 (r363303) +++ head/sys/compat/linux/linux_file.c Sat Jul 18 11:28:40 2020 (r363304) @@ -1766,3 +1766,17 @@ linux_memfd_create(struct thread *td, struct linux_mem return (kern_shm_open2(td, SHM_ANON, oflags, 0, shmflags, NULL, memfd_name)); } + +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: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Sat Jul 18 10:56:04 2020 (r363303) +++ head/sys/i386/linux/linux_dummy.c Sat Jul 18 11:28:40 2020 (r363304) @@ -98,7 +98,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: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sat Jul 18 10:56:04 2020 (r363303) +++ head/sys/i386/linux/syscalls.master Sat Jul 18 11:28:40 2020 (r363304) @@ -1753,7 +1753,14 @@ ); } 313 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 + ); } 314 AUE_NULL STD { int linux_sync_file_range(