[svn-upgrade] Integrating new upstream version, shadow (4.0.4)
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "rcsid.h"
|
||||
RCSID("$Id: ulimit.c,v 1.2 1997/12/07 23:27:11 marekm Exp $")
|
||||
|
||||
RCSID ("$Id: ulimit.c,v 1.3 2003/04/22 10:59:22 kloczek Exp $")
|
||||
#if HAVE_ULIMIT_H
|
||||
#include <ulimit.h>
|
||||
|
||||
#ifndef UL_SETFSIZE
|
||||
#ifdef UL_SFILLIM
|
||||
#define UL_SETFSIZE UL_SFILLIM
|
||||
@@ -13,22 +11,19 @@ RCSID("$Id: ulimit.c,v 1.2 1997/12/07 23:27:11 marekm Exp $")
|
||||
#define UL_SETFSIZE 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif HAVE_SYS_RESOURCE_H
|
||||
#include <sys/time.h> /* for struct timeval on sunos4 */
|
||||
#include <sys/time.h> /* for struct timeval on sunos4 */
|
||||
/* XXX - is the above ok or should it be <time.h> on ultrix? */
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
void
|
||||
set_filesize_limit(int blocks)
|
||||
void set_filesize_limit (int blocks)
|
||||
{
|
||||
#if HAVE_ULIMIT_H
|
||||
ulimit(UL_SETFSIZE, blocks);
|
||||
ulimit (UL_SETFSIZE, blocks);
|
||||
#elif defined(RLIMIT_FSIZE)
|
||||
struct rlimit rlimit_fsize;
|
||||
|
||||
rlimit_fsize.rlim_cur = rlimit_fsize.rlim_max = 512L * blocks;
|
||||
setrlimit(RLIMIT_FSIZE, &rlimit_fsize);
|
||||
setrlimit (RLIMIT_FSIZE, &rlimit_fsize);
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user