Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Oct 2001 19:06:33 EET
From:      Maxim Sobolev <sobomax@mail.ru>
To:        rwatson@FreeBSD.ORG
Cc:        cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: ports/devel/ORBit Makefile ports/devel/ORBit/files         patch-src::IIOP::giop-msg-buffer.c
Message-ID:  <E15xtOb-0002Me-00@smtp2.port.ru>
In-Reply-To: <Pine.NEB.3.96L.1011028090805.15623B-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 28 Oct 2001 09:20:32 -0500 (EST), Robert Watson wrote:
> =

> On Sun, 28 Oct 2001, Maxim Sobolev wrote:
> =

> > On Fri, 26 Oct 2001 13:22:44 -0400 (EDT), Robert Watson wrote:
> > > =

> > > Are you exceeding UIO_MAXIOV entries in the array?  Right now, I thin=
k
> > > it's 35, which for dynamically generated entries, could be too small.
> > > That error will result in EINVAL, and is documented in the man page.
> > =

> > Yes, I've already been clued about this, though it's not a 35, but
> > 1,024. :) =

> =

> Hmm.  I have no idea where the number 35 came from. :-)  Maybe another
> platform -- I notice that Solaris actually sets it to 16:

It seems that it's the value of KERN_IOV_MAX from sys/sysctl.h.

>   /usr/include/limits.h:#define   IOV_MAX         _XOPEN_IOV_MAX
>   /usr/include/limits.h:#define   _XOPEN_IOV_MAX  16      /* max #iovec/p=
rocess with readv()/writev() */
> =

> My local Linux box has:
> =

>   ...
>   linux/uio.h: *  UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
>   ...
>   #define UIO_MAXIOV      1024
>   #if 0
>   #define UIO_MAXIOV      16      /* Maximum iovec's in one operation =

>                                      16 matches BSD */
>                                   /* Beg pardon: BSD has 1024 --ANK */
>   #endif

I doubt that Linux is really enforces this limit, because if it
does, then the ORBit would be broken there as well. BTW, could you
please do me a favor and run the following program on your Linux
box and send me its output? It tests and reports real value of the
limit.

#include <sys/types.h>
#include <sys/uio.h>
#include <fcntl.h>
#include <stdio.h>
int main()
{
        int fd, i;          =

        static struct iovec iovecs[16385];
        if ((fd =3D open("/dev/null", O_WRONLY)) < 0)
                exit(1);    =

        for (i =3D 1; i < 16386 && writev(fd, iovecs, i) >=3D 0; i++);
        printf("%d\n", i - 1);
        close(fd);          =

        exit(0);            =

}

-Maxim

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E15xtOb-0002Me-00>