Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vitaly _Vi Shukela
committed
Dec 9, 2010
0 parents
commit 170b973
Showing
5 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.o | ||
lib*so* | ||
.*.sw* | ||
~* | ||
tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Lock all pages in memory for a process tree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <stdio.h> | ||
#include <sys/mman.h> | ||
|
||
void __attribute__((constructor)) init() { | ||
if(mlockall(MCL_CURRENT|MCL_FUTURE)) { | ||
perror("mlockall"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
LD_PRELOAD="$LD_PRELOAD /usr/lib/libmlockall.so" "$@" |