Skip to content

Commit

Permalink
first post
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly _Vi Shukela committed Dec 9, 2010
0 parents commit 170b973
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
@@ -0,0 +1,5 @@
*.o
lib*so*
.*.sw*
~*
tags
13 changes: 13 additions & 0 deletions 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 change: 1 addition & 0 deletions README
@@ -0,0 +1 @@
Lock all pages in memory for a process tree
8 changes: 8 additions & 0 deletions 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 changes: 2 additions & 0 deletions mlockall
@@ -0,0 +1,2 @@
#!/bin/sh
LD_PRELOAD="$LD_PRELOAD /usr/lib/libmlockall.so" "$@"

0 comments on commit 170b973

Please sign in to comment.