Assume RLIMIT_NOFILE 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:56:43 +01:00 committed by Serge Hallyn
parent 5ebf28c999
commit c916715a6c
2 changed files with 0 additions and 4 deletions

View File

@ -282,13 +282,11 @@ static int do_user_limits (const char *buf, const char *name)
retval |= setrlimit_value (RLIMIT_MEMLOCK, pp, 1024);
break;
#endif
#ifdef RLIMIT_NOFILE
case 'n':
case 'N':
/* RLIMIT_NOFILE - max number of open files */
retval |= setrlimit_value (RLIMIT_NOFILE, pp, 1);
break;
#endif
#ifdef RLIMIT_RTPRIO
case 'o':
case 'O':

View File

@ -37,9 +37,7 @@ void pwd_init (void)
setrlimit (RLIMIT_CPU, &rlim);
setrlimit (RLIMIT_DATA, &rlim);
setrlimit (RLIMIT_FSIZE, &rlim);
#ifdef RLIMIT_NOFILE
setrlimit (RLIMIT_NOFILE, &rlim);
#endif
#ifdef RLIMIT_RSS
setrlimit (RLIMIT_RSS, &rlim);
#endif