diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 16:18:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 16:18:37 +0000 |
commit | b6b00dd55e035bfbe311a527b567962ffa77ee43 (patch) | |
tree | cafc4d13785448e5a78bd40a51697ee07f07ac12 /lib/ulimit.c | |
parent | Adding debian version 1:4.13+dfsg1-5. (diff) | |
download | shadow-b6b00dd55e035bfbe311a527b567962ffa77ee43.tar.xz shadow-b6b00dd55e035bfbe311a527b567962ffa77ee43.zip |
Merging upstream version 1:4.15.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | lib/ulimit.c (renamed from libmisc/ulimit.c) | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/libmisc/ulimit.c b/lib/ulimit.c index e331d46..45a184a 100644 --- a/libmisc/ulimit.c +++ b/lib/ulimit.c @@ -11,36 +11,18 @@ #ident "$Id$" -#if HAVE_ULIMIT_H -#include <ulimit.h> -#ifndef UL_SETFSIZE -#ifdef UL_SFILLIM -#define UL_SETFSIZE UL_SFILLIM -#else -#define UL_SETFSIZE 2 -#endif -#endif -#elif HAVE_SYS_RESOURCE_H -#include <sys/time.h> /* for struct timeval on sunos4 */ -/* XXX - is the above ok or should it be <time.h> on ultrix? */ +#include <sys/time.h> #include <sys/resource.h> -#endif #include "prototypes.h" int set_filesize_limit (int blocks) { int ret = -1; -#if HAVE_ULIMIT_H - if (ulimit (UL_SETFSIZE, blocks) != -1) { - ret = 0; - } -#elif 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; } |