fstream->optimal_block_size =
I_MIN(st.st_blksize, MAX_OPTIMAL_BLOCK_SIZE);
}
+#ifndef HAVE_LINUX_SENDFILE
+ /* only Linux supports sendfile() with non-sockets. Other
+ systems fail more or less gracefully if it's tried, so
+ don't bother to even try with them. */
+ fstream->no_sendfile = TRUE;
+#endif
+ } else {
+ if (net_getsockname(fd, NULL, NULL) < 0)
+ fstream->no_sendfile = TRUE;
}
return ostream;
}
i_assert(count <= SSIZE_T_MAX);
- /* outfd must be socket, or at least some Solaris versions will
+ /* NOTE: if outfd is not a socket, some Solaris versions will
kernel panic */
- if (net_getsockname(out_fd, NULL, NULL) < 0) {
- errno = EINVAL;
- return -1;
- }
vec.sfv_fd = in_fd;
vec.sfv_flag = 0;