Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_socket.c
| Show First 20 Lines • Show All 2,449 Lines • ▼ Show 20 Lines | sendfile_fallback(struct thread *td, struct file *fp, l_int out, | ||||
| if (seekable) { | if (seekable) { | ||||
| if ((error = fo_seek(ofp, 0, SEEK_CUR, td)) != 0) | if ((error = fo_seek(ofp, 0, SEEK_CUR, td)) != 0) | ||||
| goto drop; | goto drop; | ||||
| out_offset = td->td_uretoff.tdu_off; | out_offset = td->td_uretoff.tdu_off; | ||||
| } else | } else | ||||
| out_offset = 0; | out_offset = 0; | ||||
| flags = FOF_OFFSET | FOF_NOUPDATE; | flags = FOF_OFFSET | FOF_NOUPDATE; | ||||
| bufsz = min(count, MAXPHYS); | bufsz = min(count, maxphys); | ||||
| buf = malloc(bufsz, M_LINUX, M_WAITOK); | buf = malloc(bufsz, M_LINUX, M_WAITOK); | ||||
| bytes_sent = 0; | bytes_sent = 0; | ||||
| while (bytes_sent < count) { | while (bytes_sent < count) { | ||||
| to_send = min(count - bytes_sent, bufsz); | to_send = min(count - bytes_sent, bufsz); | ||||
| aiov.iov_base = buf; | aiov.iov_base = buf; | ||||
| aiov.iov_len = bufsz; | aiov.iov_len = bufsz; | ||||
| auio.uio_iov = &aiov; | auio.uio_iov = &aiov; | ||||
| auio.uio_iovcnt = 1; | auio.uio_iovcnt = 1; | ||||
| ▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines | |||||