Assume RLIMIT_CPU 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:52:52 +01:00 committed by Serge Hallyn
parent 7a4906fc75
commit 891d8dbedd
2 changed files with 0 additions and 4 deletions

View File

@ -318,13 +318,11 @@ static int do_user_limits (const char *buf, const char *name)
retval |= setrlimit_value (RLIMIT_STACK, pp, 1024); retval |= setrlimit_value (RLIMIT_STACK, pp, 1024);
break; break;
#endif #endif
#ifdef RLIMIT_CPU
case 't': case 't':
case 'T': case 'T':
/* RLIMIT_CPU - max CPU time (MIN) */ /* RLIMIT_CPU - max CPU time (MIN) */
retval |= setrlimit_value (RLIMIT_CPU, pp, 60); retval |= setrlimit_value (RLIMIT_CPU, pp, 60);
break; break;
#endif
#ifdef RLIMIT_NPROC #ifdef RLIMIT_NPROC
case 'u': case 'u':
case 'U': case 'U':

View File

@ -34,9 +34,7 @@ void pwd_init (void)
rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY; rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY;
setrlimit (RLIMIT_AS, &rlim); setrlimit (RLIMIT_AS, &rlim);
#ifdef RLIMIT_CPU
setrlimit (RLIMIT_CPU, &rlim); setrlimit (RLIMIT_CPU, &rlim);
#endif
#ifdef RLIMIT_DATA #ifdef RLIMIT_DATA
setrlimit (RLIMIT_DATA, &rlim); setrlimit (RLIMIT_DATA, &rlim);
#endif #endif