MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / sendfile

Function sendfile

net/basic_socket.cpp:145–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count,
146 Timeout timeout) {
147#ifdef __APPLE__
148 off_t len = count;
149 ssize_t ret = DOIO_ONCE(::sendfile(out_fd, in_fd, *offset, &len, nullptr, 0),
150 wait_for_fd_writable(out_fd, timeout));
151 return (ret == 0) ? len : (int)ret;
152#else
153 return DOIO_ONCE(::sendfile(out_fd, in_fd, offset, count),
154 wait_for_fd_writable(out_fd, timeout));
155#endif
156}
157
158ssize_t read_n(int fd, void *buf, size_t count, Timeout timeout) {
159 return DOIO_LOOP(read(fd, buf, count, timeout), BufStep(buf, count));

Callers 3

do_sendfileMethod · 0.85
sendfileMethod · 0.85
sendfile_nFunction · 0.85

Calls 1

wait_for_fd_writableFunction · 0.50

Tested by

no test coverage detected