فهرست منبع

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
Steven Dake 21 سال پیش
والد
کامیت
d5d47a4e11
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      exec/main.c

+ 7 - 0
exec/main.c

@@ -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) {