> From [EMAIL PROTECTED] Thu Sep  9 18:10:06 1999

>       I am creating about 100 icmp sockets, and as they are
> created, allocate a very large SO_RCVBUF:
>         (void)setsockopt(localstruct->icmp_s, SOL_SOCKET,
>                 SO_RCVBUF, (char *)&hold, sizeof(hold));

This can be a part of the problem too.

setsockopt() have to check if there is really free memory for buffer and
set an appropriate, described in man page errno if failed.

In my test, 2.2.7 kernel allowed me to "allocate" in this way 15M "for buffers"
on a 32M machine (NMBCLUSTERS=1024, maxusers=50). Probably it could
allow more, but I thought 15M is too much anyways.
There is a limitation - buffer can not be bigger than ~240k. I did
not checked which errno setsockopt() returns, but I didn't found
anything appropriate in a man page.


--
Stas Kisel. UNIX, security, C, TCP/IP, Web. UNIX - the best adventure game
http://www.tekmetrics.com/transcript.shtml?pid=20053 http://www.crimea.edu
+380(652)510222,230238 ; [EMAIL PROTECTED] [EMAIL PROTECTED] ; 2:460/54.4



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to