aboutsummaryrefslogtreecommitdiff
path: root/pd/src/s_inter.c
diff options
context:
space:
mode:
Diffstat (limited to 'pd/src/s_inter.c')
-rw-r--r--pd/src/s_inter.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pd/src/s_inter.c b/pd/src/s_inter.c
index 3a659080..f95dbc50 100644
--- a/pd/src/s_inter.c
+++ b/pd/src/s_inter.c
@@ -18,6 +18,7 @@ that didn't really belong anywhere. */
#include <stdlib.h>
#include <sys/time.h>
#include <sys/mman.h>
+#include <sys/resource.h>
#endif
#ifdef HAVE_BSTRING_H
#include <bstring.h>
@@ -278,6 +279,12 @@ void sys_set_priority(int higher)
#endif
#ifdef _POSIX_MEMLOCK
+ /* tb: force memlock to physical memory { */
+ struct rlimit mlock_limit;
+ mlock_limit.rlim_cur=0;
+ mlock_limit.rlim_max=0;
+ setrlimit(RLIMIT_MEMLOCK,&mlock_limit);
+ /* } tb */
if (mlockall(MCL_FUTURE) != -1)
fprintf(stderr, "memory locking enabled.\n");
#endif