Assume RLIMIT_STACK 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:57:47 +01:00 committed by Serge Hallyn
parent c916715a6c
commit 74c8015730
2 changed files with 0 additions and 4 deletions

View File

@ -305,13 +305,11 @@ static int do_user_limits (const char *buf, const char *name)
retval |= setrlimit_value (RLIMIT_RSS, pp, 1024);
break;
#endif
#ifdef RLIMIT_STACK
case 's':
case 'S':
/* RLIMIT_STACK - max stack size (KB) */
retval |= setrlimit_value (RLIMIT_STACK, pp, 1024);
break;
#endif
case 't':
case 'T':
/* RLIMIT_CPU - max CPU time (MIN) */

View File

@ -41,9 +41,7 @@ void pwd_init (void)
#ifdef RLIMIT_RSS
setrlimit (RLIMIT_RSS, &rlim);
#endif
#ifdef RLIMIT_STACK
setrlimit (RLIMIT_STACK, &rlim);
#endif
signal (SIGALRM, SIG_IGN);
signal (SIGHUP, SIG_IGN);