| 227 | } |
| 228 | |
| 229 | int |
| 230 | kern_pread(struct thread *td, int fd, void *buf, size_t nbyte, off_t offset) |
| 231 | { |
| 232 | struct uio auio; |
| 233 | struct iovec aiov; |
| 234 | int error; |
| 235 | |
| 236 | if (nbyte > IOSIZE_MAX) |
| 237 | return (EINVAL); |
| 238 | aiov.iov_base = buf; |
| 239 | aiov.iov_len = nbyte; |
| 240 | auio.uio_iov = &aiov; |
| 241 | auio.uio_iovcnt = 1; |
| 242 | auio.uio_resid = nbyte; |
| 243 | auio.uio_segflg = UIO_USERSPACE; |
| 244 | error = kern_preadv(td, fd, &auio, offset); |
| 245 | return (error); |
| 246 | } |
| 247 | |
| 248 | #if defined(COMPAT_FREEBSD6) |
| 249 | int |
no test coverage detected