[Dovecot] Misbehavior with Dovecot and Mulberry
Kenneth Porter
shiva at sewingwitch.com
Tue Sep 27 05:58:37 EEST 2005
--On Monday, September 26, 2005 7:58 PM -0500 Jon Roma <roma at uiuc.edu>
wrote:
> The Linux man page for writev(2) says that the vector count must be
> between 0 and MAX_IOVEC. MAX_IOVEC is defined as 10 in
> <linux/sunrpc/xprt.h>, which doesn't seem a logical place for it.
> Anyway, on RHEL 3, UIO_MAXIOV is defined in <linux/uio.h> and <bits/uio.h>
> and IOV_MAX is defined in <bits/stdio_lim.h> -- and is defined as 1024
> in these definitions. There's also a _POSIX_UIO_MAXIOV defined at 16
> in <bits/posix1_lim.h>.
>
> My suspicion is that the Linux man page is wrong with respect to the
> preprocessor variable that matters.
I poked around in glibc and kernel sources (FC2) and found UIO_MAXIOV and
IOV_MAX are the two symbols in use and are set to 1024. Googling for these
two symbols together turned up this interesting nugget:
<http://lists.freebsd.org/pipermail/freebsd-standards/2004-February/000399.html>
The search:
<http://www.google.com/search?num=100&hl=en&lr=&safe=off&c2coff=1&q=uio_maxiov+iov_max&btnG=Search>
The glibc code looks like in some circumstances it mallocs a temporary
buffer to assemble the write and then issues a write() on the temporary.
Additionally, each filesystem driver gets a chance to independently choose
how to implement writev, with many passing it to a generic version of the
function.
More information about the dovecot
mailing list