bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SOMAXCONN


From: Roland McGrath
Subject: Re: SOMAXCONN
Date: Wed, 25 Jul 2001 04:35:17 -0400 (EDT)

Assuming that its use is to pass to listen, it's always harmless to use an
arbitrarily large value (on any system).  When SOMAXCONN is defined, that's
the largest value the system's network stack will actually use.  If the
listen function's argument is larger than the actual limit, it's just
silently capped to that value.  (In the oldest systems with this interface,
SOMAXCONN is not defined at all and the internal limit is only 5.)

Inserting:

#ifndef SOMAXCONN
#define SOMAXCONN 128
#endif

is an entirely reasonable and portable thing to do.

I believe we talked about SOMAXCONN before.  In fact, I suspect that Mark
Kettenis has a new bits/socket.h file ready to go into libc that defines
this among other things.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]