Assume <sys/resource.h> exists

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:20:55 +01:00 committed by Serge Hallyn
parent cdaa04e460
commit 9d695340b4
4 changed files with 19 additions and 30 deletions

View File

@ -38,7 +38,7 @@ dnl Checks for libraries.
dnl Checks for header files.
AC_CHECK_HEADERS(crypt.h utmp.h \
termio.h sgtty.h sys/ioctl.h paths.h \
sys/capability.h sys/random.h sys/resource.h \
sys/capability.h sys/random.h \
gshadow.h lastlog.h rpc/key_prot.h netdb.h acl/libacl.h \
attr/libattr.h attr/error_context.h)

View File

@ -28,10 +28,8 @@
#include <pwd.h>
#include "getdef.h"
#include "shadowlog.h"
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#define LIMITS
#endif
#ifdef LIMITS
#ifndef LIMITS_FILE
#define LIMITS_FILE "/etc/limits"

View File

@ -15,9 +15,7 @@
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#include "prototypes.h"
@ -28,7 +26,6 @@
*/
void pwd_init (void)
{
#ifdef HAVE_SYS_RESOURCE_H
struct rlimit rlim;
#ifdef RLIMIT_CORE
@ -57,10 +54,6 @@ void pwd_init (void)
#ifdef RLIMIT_STACK
setrlimit (RLIMIT_STACK, &rlim);
#endif
#else /* !HAVE_SYS_RESOURCE_H */
set_filesize_limit (30000);
/* don't know how to set the other limits... */
#endif /* !HAVE_SYS_RESOURCE_H */
signal (SIGALRM, SIG_IGN);
signal (SIGHUP, SIG_IGN);

View File

@ -11,11 +11,9 @@
#ident "$Id$"
#if 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/resource.h>
#endif
#include "prototypes.h"
int set_filesize_limit (int blocks)