| 4899 | } |
| 4900 | |
| 4901 | int |
| 4902 | sys_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 | } |
nothing calls this directly
no test coverage detected