Add rlimit code to allow openais to work with linux kernel 2.6.9 or later

(Logical change 1.99)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@368 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2004-10-30 00:07:11 +00:00
parent 4b80d3cfa8
commit d5d47a4e11

View File

@ -41,6 +41,8 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/sysinfo.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
@ -841,6 +843,11 @@ return;
static void aisexec_mlockall (void)
{
int res;
struct rlimit rlimit;
rlimit.rlim_cur = RLIM_INFINITY;
rlimit.rlim_max = RLIM_INFINITY;
setrlimit (RLIMIT_MEMLOCK, &rlimit);
res = mlockall (MCL_CURRENT | MCL_FUTURE);
if (res == -1) {