The conversion to c99-style designated initialisers brought in the gcc

extension of specifying an array range.  Revert to runtime initialization
of limit0.

See here for details: http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
This commit is contained in:
gmcgarry 2008-06-24 10:31:05 +00:00
parent a7edd5ccdd
commit 8cead24f2a

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_proc.c,v 1.142 2008/05/19 17:06:02 ad Exp $ */
/* $NetBSD: kern_proc.c,v 1.143 2008/06/24 10:31:05 gmcgarry Exp $ */
/*-
* Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.142 2008/05/19 17:06:02 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.143 2008/06/24 10:31:05 gmcgarry Exp $");
#include "opt_kstack.h"
#include "opt_maxuprc.h"
@ -156,16 +156,7 @@ struct cwdinfo cwdi0 = {
.cwdi_cmask = CMASK, /* see cmask below */
.cwdi_refcnt = 1,
};
struct plimit limit0 = {
.pl_corename = defcorename,
.pl_refcnt = 1,
.pl_rlimit = {
[0 ... __arraycount(limit0.pl_rlimit) - 1] = {
.rlim_cur = RLIM_INFINITY,
.rlim_max = RLIM_INFINITY,
},
},
};
struct plimit limit0;
struct pstats pstat0;
struct vmspace vmspace0;
struct sigacts sigacts0;
@ -290,6 +281,7 @@ proc0_init(void)
struct session *sess;
struct lwp *l;
rlim_t lim;
int i;
p = &proc0;
pg = &pgrp0;
@ -335,6 +327,9 @@ proc0_init(void)
/* Create the limits structures. */
mutex_init(&limit0.pl_lock, MUTEX_DEFAULT, IPL_NONE);
for (i = 0; i < __arraycount(limit0.pl_rlimit); i++)
limit0.pl_rlimit[i].rlim_cur =
limit0.pl_rlimit[i].rlim_max = RLIM_INFINITY;
limit0.pl_rlimit[RLIMIT_NOFILE].rlim_max = maxfiles;
limit0.pl_rlimit[RLIMIT_NOFILE].rlim_cur =
@ -348,6 +343,9 @@ proc0_init(void)
limit0.pl_rlimit[RLIMIT_RSS].rlim_max = lim;
limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_max = lim;
limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = lim / 3;
limit0.pl_corename = defcorename;
limit0.pl_refcnt = 1;
limit0.pl_sv_limit = NULL;
/* Configure virtual memory system, set vm rlimits. */
uvm_init_limits(p);