Avoid use of "maxfiles" and "maxfilesperproc"

This commit is contained in:
Sebastian Huber 2013-10-30 11:18:03 +01:00
parent 371881668c
commit f3ffa87cc9
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -51,8 +51,6 @@
int maxproc = 32; /* XXX Used value of rtems KERN_MAXPROC */
int ngroups_max = NGROUPS_MAX; /* XXX */
int maxfiles = 7; /* XXX sys. wide open files limit */
int maxfilesperproc = 27; /* XXX per-proc open files limit */
uintptr_t dpcpu_off[MAXCPU];
void