Assume RLIMIT_AS is defined

It is required by POSIX.1-2001.

Cc: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar 2022-12-02 22:51:41 +01:00 committed by Serge Hallyn
parent e1a39e1dfc
commit 7a4906fc75
2 changed files with 1 additions and 4 deletions

View File

@ -239,13 +239,11 @@ static int do_user_limits (const char *buf, const char *name)
while ('\0' != *pp) { while ('\0' != *pp) {
switch (*pp++) { switch (*pp++) {
#ifdef RLIMIT_AS
case 'a': case 'a':
case 'A': case 'A':
/* RLIMIT_AS - max address space (KB) */ /* RLIMIT_AS - max address space (KB) */
retval |= setrlimit_value (RLIMIT_AS, pp, 1024); retval |= setrlimit_value (RLIMIT_AS, pp, 1024);
break; break;
#endif
case 'c': case 'c':
case 'C': case 'C':
/* RLIMIT_CORE - max core file size (KB) */ /* RLIMIT_CORE - max core file size (KB) */

View File

@ -32,9 +32,8 @@ void pwd_init (void)
setrlimit (RLIMIT_CORE, &rlim); setrlimit (RLIMIT_CORE, &rlim);
rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY; rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY;
#ifdef RLIMIT_AS
setrlimit (RLIMIT_AS, &rlim); setrlimit (RLIMIT_AS, &rlim);
#endif
#ifdef RLIMIT_CPU #ifdef RLIMIT_CPU
setrlimit (RLIMIT_CPU, &rlim); setrlimit (RLIMIT_CPU, &rlim);
#endif #endif