AM_CONDITIONAL(HAVE_PRLIMIT, true)
AC_DEFINE(HAVE_PRLIMIT,1,[Have prlimit]),
AM_CONDITIONAL(HAVE_PRLIMIT, false))
+AC_CHECK_FUNCS([prlimit64],
+ AM_CONDITIONAL(HAVE_PRLIMIT64, true)
+ AC_DEFINE(HAVE_PRLIMIT64,1,[Have prlimit64]),
+ AM_CONDITIONAL(HAVE_PRLIMIT64, false))
# Check for some libraries
AC_SEARCH_LIBS(sem_open, [rt pthread])
../include/ifaddrs.h \
../include/openpty.h \
../include/lxcmntent.h
+endif
+
if !HAVE_PRLIMIT
+if HAVE_PRLIMIT64
noinst_HEADERS += ../include/prlimit.h
endif
endif
../include/ifaddrs.c ../include/ifaddrs.h \
../include/openpty.c ../include/openpty.h \
../include/lxcmntent.c ../include/lxcmntent.h
+endif
+
if !HAVE_PRLIMIT
+if HAVE_PRLIMIT64
liblxc_la_SOURCES += ../include/prlimit.c ../include/prlimit.h
endif
endif
#if IS_BIONIC
#include <../include/lxcmntent.h>
-#ifndef HAVE_PRLIMIT
-#include <../include/prlimit.h>
-#endif
#else
#include <mntent.h>
#endif
+#if !defined(HAVE_PRLIMIT) && defined(HAVE_PRLIMIT64)
+#include <../include/prlimit.h>
+#endif
+
lxc_log_define(lxc_conf, lxc);
#if HAVE_LIBCAP
return -1;
}
+#if HAVE_PRLIMIT || HAVE_PRLIMIT64
if (prlimit(pid, resid, &lim->limit, NULL) != 0) {
ERROR("failed to set limit %s: %s", lim->resource, strerror(errno));
return -1;
}
+#else
+ ERROR("Cannot set limit %s as prlimit is missing", lim->resource);
+ return -1;
+#endif
}
return 0;
}