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
This commit is contained in:
Edward Tomasz Napierala 2020-07-18 11:28:40 +00:00
parent 978ffef22f
commit 8d1d017175
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363304
9 changed files with 46 additions and 8 deletions

View File

@ -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: */

View File

@ -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);

View File

@ -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: */

View File

@ -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(

View File

@ -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: */

View File

@ -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);

View File

@ -1766,3 +1766,17 @@ linux_memfd_create(struct thread *td, struct linux_memfd_create_args *args)
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);
}

View File

@ -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: */

View File

@ -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(