From b6b00dd55e035bfbe311a527b567962ffa77ee43 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 26 Jun 2024 18:18:37 +0200 Subject: Merging upstream version 1:4.15.2. Signed-off-by: Daniel Baumann --- libmisc/ulimit.c | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 libmisc/ulimit.c (limited to 'libmisc/ulimit.c') diff --git a/libmisc/ulimit.c b/libmisc/ulimit.c deleted file mode 100644 index e331d46..0000000 --- a/libmisc/ulimit.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh - * SPDX-FileCopyrightText: 1996 - 1997, Marek Michałkiewicz - * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko - * SPDX-FileCopyrightText: 2008 , Nicolas François - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include - -#ident "$Id$" - -#if HAVE_ULIMIT_H -#include -#ifndef UL_SETFSIZE -#ifdef UL_SFILLIM -#define UL_SETFSIZE UL_SFILLIM -#else -#define UL_SETFSIZE 2 -#endif -#endif -#elif HAVE_SYS_RESOURCE_H -#include /* for struct timeval on sunos4 */ -/* XXX - is the above ok or should it be on ultrix? */ -#include -#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; -} - -- cgit v1.2.3