~ubuntu-branches/ubuntu/precise/puredata/precise

« back to all changes in this revision

Viewing changes to debian/patches/03_2.6mlock.patch

  • Committer: Bazaar Package Importer
  • Author(s): Guenter Geiger (Debian/GNU)
  • Date: 2005-12-13 16:11:21 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051213161121-hle84h3eh5m7oybr
Tags: 0.39.2-1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -ruN pd-0.38-4-old/src/s_inter.c pd-0.38-4/src/s_inter.c
2
 
--- pd-0.38-4-old/src/s_inter.c 2005-01-07 19:15:05.000000000 +0100
3
 
+++ pd-0.38-4/src/s_inter.c     2005-04-08 16:26:39.773263512 +0200
4
 
@@ -247,6 +247,8 @@
5
 
 
6
 
 #if defined(_POSIX_PRIORITY_SCHEDULING) || defined(_POSIX_MEMLOCK)
7
 
 #include <sched.h>
8
 
+#include <sys/mman.h>
9
 
+#include <sys/resource.h>
10
 
 #endif
11
 
 
12
 
 void sys_set_priority(int higher) 
13
 
@@ -267,6 +269,13 @@
14
 
 #endif
15
 
 
16
 
 #ifdef _POSIX_MEMLOCK
17
 
+    /* tb: force memlock to physical memory { */
18
 
+    struct rlimit mlock_limit;
19
 
+    mlock_limit.rlim_cur=0;
20
 
+    mlock_limit.rlim_max=0;
21
 
+    setrlimit(RLIMIT_MEMLOCK,&mlock_limit);
22
 
+    /* } tb */
23
 
+           
24
 
     if (mlockall(MCL_FUTURE) != -1) 
25
 
         fprintf(stderr, "memory locking enabled.\n");
26
 
 #endif