mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-15 04:46:59 +08:00
Avoid use of "maxfiles" and "maxfilesperproc"
This commit is contained in:
parent
371881668c
commit
f3ffa87cc9
@ -223,10 +223,12 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS)
|
|||||||
if (error == 0 && req->newptr) {
|
if (error == 0 && req->newptr) {
|
||||||
if (newmaxsockets > maxsockets) {
|
if (newmaxsockets > maxsockets) {
|
||||||
maxsockets = newmaxsockets;
|
maxsockets = newmaxsockets;
|
||||||
|
#ifndef __rtems__
|
||||||
if (maxsockets > ((maxfiles / 4) * 3)) {
|
if (maxsockets > ((maxfiles / 4) * 3)) {
|
||||||
maxfiles = (maxsockets * 5) / 4;
|
maxfiles = (maxsockets * 5) / 4;
|
||||||
maxfilesperproc = (maxfiles * 9) / 10;
|
maxfilesperproc = (maxfiles * 9) / 10;
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
EVENTHANDLER_INVOKE(maxsockets_change);
|
EVENTHANDLER_INVOKE(maxsockets_change);
|
||||||
} else
|
} else
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
@ -247,7 +249,11 @@ init_maxsockets(void *ignored)
|
|||||||
{
|
{
|
||||||
|
|
||||||
TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets);
|
TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets);
|
||||||
|
#ifndef __rtems__
|
||||||
maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters));
|
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);
|
SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL);
|
||||||
|
|
||||||
|
@ -51,8 +51,6 @@
|
|||||||
int maxproc = 32; /* XXX Used value of rtems KERN_MAXPROC */
|
int maxproc = 32; /* XXX Used value of rtems KERN_MAXPROC */
|
||||||
int ngroups_max = NGROUPS_MAX; /* XXX */
|
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];
|
uintptr_t dpcpu_off[MAXCPU];
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user