MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sys_copy_file_range

Function sys_copy_file_range

freebsd/kern/vfs_syscalls.c:4901–4927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4899}
4900
4901int
4902sys_copy_file_range(struct thread *td, struct copy_file_range_args *uap)
4903{
4904 off_t inoff, outoff, *inoffp, *outoffp;
4905 int error;
4906
4907 inoffp = outoffp = NULL;
4908 if (uap->inoffp != NULL) {
4909 error = copyin(uap->inoffp, &inoff, sizeof(off_t));
4910 if (error != 0)
4911 return (error);
4912 inoffp = &inoff;
4913 }
4914 if (uap->outoffp != NULL) {
4915 error = copyin(uap->outoffp, &outoff, sizeof(off_t));
4916 if (error != 0)
4917 return (error);
4918 outoffp = &outoff;
4919 }
4920 error = kern_copy_file_range(td, uap->infd, inoffp, uap->outfd,
4921 outoffp, uap->len, uap->flags);
4922 if (error == 0 && uap->inoffp != NULL)
4923 error = copyout(inoffp, uap->inoffp, sizeof(off_t));
4924 if (error == 0 && uap->outoffp != NULL)
4925 error = copyout(outoffp, uap->outoffp, sizeof(off_t));
4926 return (error);
4927}

Callers

nothing calls this directly

Calls 3

kern_copy_file_rangeFunction · 0.85
copyinFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected