export sys/types.h export sys/socket.h export sys/uio.h use net def TCP_CORK TCP_NOPUSH # see http://dotat.at/writing/nopush.html, disabling NOPUSH does not send def sendfile(out_fd, in_fd, offset, count) sendfile_linux_compat(out_fd, in_fd, offset, count) ssize_t sendfile_linux_compat(int out_fd, int in_fd, off_t *offset, size_t count) off_t count_1 = count int rv = sendfile(in_fd, out_fd, *offset, &count_1, NULL, 0) if rv < 0: return rv return (ssize_t)count_1 int darwin_net # placeholder