| 428 | } |
| 429 | |
| 430 | int |
| 431 | kern_pwrite(struct thread *td, int fd, const void *buf, size_t nbyte, |
| 432 | off_t offset) |
| 433 | { |
| 434 | struct uio auio; |
| 435 | struct iovec aiov; |
| 436 | int error; |
| 437 | |
| 438 | if (nbyte > IOSIZE_MAX) |
| 439 | return (EINVAL); |
| 440 | aiov.iov_base = (void *)(uintptr_t)buf; |
| 441 | aiov.iov_len = nbyte; |
| 442 | auio.uio_iov = &aiov; |
| 443 | auio.uio_iovcnt = 1; |
| 444 | auio.uio_resid = nbyte; |
| 445 | auio.uio_segflg = UIO_USERSPACE; |
| 446 | error = kern_pwritev(td, fd, &auio, offset); |
| 447 | return (error); |
| 448 | } |
| 449 | |
| 450 | #if defined(COMPAT_FREEBSD6) |
| 451 | int |
no test coverage detected