| 390 | }; |
| 391 | #endif |
| 392 | int |
| 393 | sys_write(struct thread *td, struct write_args *uap) |
| 394 | { |
| 395 | struct uio auio; |
| 396 | struct iovec aiov; |
| 397 | int error; |
| 398 | |
| 399 | if (uap->nbyte > IOSIZE_MAX) |
| 400 | return (EINVAL); |
| 401 | aiov.iov_base = (void *)(uintptr_t)uap->buf; |
| 402 | aiov.iov_len = uap->nbyte; |
| 403 | auio.uio_iov = &aiov; |
| 404 | auio.uio_iovcnt = 1; |
| 405 | auio.uio_resid = uap->nbyte; |
| 406 | auio.uio_segflg = UIO_USERSPACE; |
| 407 | error = kern_writev(td, uap->fd, &auio); |
| 408 | return (error); |
| 409 | } |
| 410 | |
| 411 | /* |
| 412 | * Positioned write system call. |
nothing calls this directly
no test coverage detected