| 344 | } |
| 345 | |
| 346 | int |
| 347 | copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error) |
| 348 | { |
| 349 | u_int iovlen; |
| 350 | |
| 351 | *iov = NULL; |
| 352 | if (iovcnt > UIO_MAXIOV) |
| 353 | return (error); |
| 354 | iovlen = iovcnt * sizeof (struct iovec); |
| 355 | *iov = malloc(iovlen, M_IOV, M_WAITOK); |
| 356 | error = copyin(iovp, *iov, iovlen); |
| 357 | if (error) { |
| 358 | free(*iov, M_IOV); |
| 359 | *iov = NULL; |
| 360 | } |
| 361 | return (error); |
| 362 | } |
| 363 | |
| 364 | int |
| 365 | copyinuio(const struct iovec *iovp, u_int iovcnt, struct uio **uiop) |
no test coverage detected