| 1150 | } |
| 1151 | |
| 1152 | ssize_t |
| 1153 | ff_writev(int fd, const struct iovec *iov, int iovcnt) |
| 1154 | { |
| 1155 | struct uio auio; |
| 1156 | int i, rc, len; |
| 1157 | |
| 1158 | len = 0; |
| 1159 | for (i = 0; i < iovcnt; i++) |
| 1160 | len += iov[i].iov_len; |
| 1161 | auio.uio_iov = __DECONST(struct iovec *, iov); |
| 1162 | auio.uio_iovcnt = iovcnt; |
| 1163 | auio.uio_resid = len; |
| 1164 | auio.uio_segflg = UIO_SYSSPACE; |
| 1165 | if ((rc = kern_writev(curthread, fd, &auio))) |
| 1166 | goto kern_fail; |
| 1167 | rc = curthread->td_retval[0]; |
| 1168 | |
| 1169 | return (rc); |
| 1170 | kern_fail: |
| 1171 | ff_os_errno(rc); |
| 1172 | return (-1); |
| 1173 | } |
| 1174 | |
| 1175 | ssize_t |
| 1176 | ff_send(int s, const void *buf, size_t len, int flags) |
no test coverage detected