mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-15 07:43:54 +08:00
Avoid use of "maxfiles" and "maxfilesperproc"
This commit is contained in:
@@ -223,10 +223,12 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS)
|
||||
if (error == 0 && req->newptr) {
|
||||
if (newmaxsockets > maxsockets) {
|
||||
maxsockets = newmaxsockets;
|
||||
#ifndef __rtems__
|
||||
if (maxsockets > ((maxfiles / 4) * 3)) {
|
||||
maxfiles = (maxsockets * 5) / 4;
|
||||
maxfilesperproc = (maxfiles * 9) / 10;
|
||||
}
|
||||
#endif /* __rtems__ */
|
||||
EVENTHANDLER_INVOKE(maxsockets_change);
|
||||
} else
|
||||
error = EINVAL;
|
||||
@@ -247,7 +249,11 @@ init_maxsockets(void *ignored)
|
||||
{
|
||||
|
||||
TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets);
|
||||
#ifndef __rtems__
|
||||
maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters));
|
||||
#else /* __rtems__ */
|
||||
maxsockets = imax(maxsockets, nmbclusters);
|
||||
#endif /* __rtems__ */
|
||||
}
|
||||
SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL);
|
||||
|
||||
|
Reference in New Issue
Block a user