AM_CONDITIONAL(BUILD_CHCPU, test "x$build_chcpu" = xyes)
+UL_BUILD_INIT([prlimit], [check])
+UL_REQUIRES_LINUX([prlimit])
+UL_REQUIRES_SYSCALL_CHECK([prlimit], [UL_CHECK_SYSCALL([prlimit64])], [prlimit64])
+AM_CONDITIONAL(BUILD_PRLIMIT, test "x$build_prlimit" = xyes)
+if test "x$build_prlimit" = xyes; then
+ AC_CHECK_FUNCS([prlimit])
+fi
+
+
AC_ARG_ENABLE([switch_root],
AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
[], enable_switch_root=check
#include "xalloc.h"
#include "strutils.h"
+#ifndef RLIMIT_RTTIME
+# define RLIMIT_RTTIME 15
+#endif
+
enum {
AS,
CORE,
static pid_t pid; /* calling process (default) */
static int verbose;
+#ifndef HAVE_PRLIMIT
+# include <sys/syscall.h>
+static int prlimit(pid_t p, int resource,
+ const struct rlimit *new_limit,
+ struct rlimit *old_limit)
+{
+ return syscall(SYS_prlimit, p, resource, new_limit, old_limit);
+}
+#endif
+
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
size_t i;