Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_file.c
Show First 20 Lines • Show All 2,033 Lines • ▼ Show 20 Lines | if ((flags & MFD_ALLOW_SEALING) != 0) | ||||
shmflags |= SHM_ALLOW_SEALING; | shmflags |= SHM_ALLOW_SEALING; | ||||
return (kern_shm_open2(td, SHM_ANON, oflags, 0, shmflags, NULL, | return (kern_shm_open2(td, SHM_ANON, oflags, 0, shmflags, NULL, | ||||
memfd_name)); | memfd_name)); | ||||
} | } | ||||
int | int | ||||
linux_splice(struct thread *td, struct linux_splice_args *args) | linux_splice(struct thread *td, struct linux_splice_args *args) | ||||
{ | { | ||||
l_loff_t inoff, outoff, *inoffp, *outoffp; | |||||
int error; | |||||
linux_msg(td, "syscall splice not really implemented"); | inoffp = outoffp = NULL; | ||||
if (args->off_in != NULL) { | |||||
error = copyin(args->off_in, &inoff, sizeof(inoff)); | |||||
if (error != 0) | |||||
return (error); | |||||
inoffp = &inoff; | |||||
} | |||||
if (args->off_out != NULL) { | |||||
error = copyin(args->off_out, &outoff, sizeof(outoff)); | |||||
if (error != 0) | |||||
return (error); | |||||
outoffp = &outoff; | |||||
} | |||||
error = kern_copy_file_range(td, args->fd_in, inoffp, args->fd_out, | |||||
outoffp, args->len, 0); | |||||
if (error == 0 && args->off_in != NULL) | |||||
error = copyout(inoffp, args->off_in, sizeof(*inoffp)); | |||||
if (error == 0 && args->off_out != NULL) | |||||
error = copyout(outoffp, args->off_out, sizeof(*outoffp)); | |||||
/* | return (error); | ||||
* 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); | |||||
} | } |