Assume RLIMIT_FSIZE 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:55:18 +01:00
committed by Serge Hallyn
parent 91adf3b8bb
commit 5ebf28c999
3 changed files with 0 additions and 6 deletions

View File

@@ -19,13 +19,11 @@
int set_filesize_limit (int blocks)
{
int ret = -1;
#if defined(RLIMIT_FSIZE)
struct rlimit rlimit_fsize;
rlimit_fsize.rlim_cur = 512L * blocks;
rlimit_fsize.rlim_max = rlimit_fsize.rlim_cur;
ret = setrlimit (RLIMIT_FSIZE, &rlimit_fsize);
#endif
return ret;
}