| 189 | }; |
| 190 | #endif |
| 191 | int |
| 192 | sys_read(struct thread *td, struct read_args *uap) |
| 193 | { |
| 194 | struct uio auio; |
| 195 | struct iovec aiov; |
| 196 | int error; |
| 197 | |
| 198 | if (uap->nbyte > IOSIZE_MAX) |
| 199 | return (EINVAL); |
| 200 | aiov.iov_base = uap->buf; |
| 201 | aiov.iov_len = uap->nbyte; |
| 202 | auio.uio_iov = &aiov; |
| 203 | auio.uio_iovcnt = 1; |
| 204 | auio.uio_resid = uap->nbyte; |
| 205 | auio.uio_segflg = UIO_USERSPACE; |
| 206 | error = kern_readv(td, uap->fd, &auio); |
| 207 | return (error); |
| 208 | } |
| 209 | |
| 210 | /* |
| 211 | * Positioned read system call |
nothing calls this directly
no test coverage detected