Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first post

  • Loading branch information...
commit 170b973814b2dd65b1a677559ba3fef8ecd8894c 0 parents
Vitaly _Vi Shukela authored
Showing with 29 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +13 −0 Makefile
  3. +1 −0  README
  4. +8 −0 libmlockall.c
  5. +2 −0  mlockall
5 .gitignore
@@ -0,0 +1,5 @@
+*.o
+lib*so*
+.*.sw*
+~*
+tags
13 Makefile
@@ -0,0 +1,13 @@
+all: libmlockall.so.0.0
+
+libmlockall.so.0.0: Makefile libmlockall.c
+ ${CC} -fPIC -shared -Wl,-soname,libmlockall.so.0 -o libmlockall.so.0.0 -lc libmlockall.c # -Wl,-export-dynamic
+ ln -fs libmlockall.so.0.0 libmlockall.so
+ ln -fs libmlockall.so.0.0 libmlockall.so.0
+clean:
+ rm -Rf *.o lib*.so*
+
+# for checkinstall
+install:
+ install lib*.so* /usr/lib/
+ install mlockall /usr/bin/
1  README
@@ -0,0 +1 @@
+Lock all pages in memory for a process tree
8 libmlockall.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+#include <sys/mman.h>
+
+void __attribute__((constructor)) init() {
+ if(mlockall(MCL_CURRENT|MCL_FUTURE)) {
+ perror("mlockall");
+ }
+}
2  mlockall
@@ -0,0 +1,2 @@
+#!/bin/sh
+LD_PRELOAD="$LD_PRELOAD /usr/lib/libmlockall.so" "$@"
Please sign in to comment.
Something went wrong with that request. Please try again.