Commit ca7269e5 authored by Reda NOUSHI's avatar Reda NOUSHI

added -n option to nocache.global

added BASEDIR to nocache.global (modifiable by sed) simplified LD_PRELOAD declaration
parent e8be1919
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
NOCACHE_PATH=$(dirname "$0") NOCACHE_PATH=$(dirname "$0")
libnocache="$NOCACHE_PATH/nocache.so" libnocache="$NOCACHE_PATH/nocache.so"
if [ -n "$LD_PRELOAD" ]; then export LD_PRELOAD="$libnocache $LD_PRELOAD"
export LD_PRELOAD="$libnocache $LD_PRELOAD"
else if [ "$1" = "-n" ]; then
export LD_PRELOAD="$libnocache" export NOCACHE_NR_FADVISE="$2"
shift 2
fi fi
exec "$@" exec "$@"
#!/bin/sh #!/bin/sh
libnocache="/usr/local/lib/nocache.so" BASEDIR="/usr/local"
libnocache="$BASEDIR/lib/nocache.so"
if [ -n "$LD_PRELOAD" ]; then export LD_PRELOAD="$libnocache $LD_PRELOAD"
export LD_PRELOAD="$libnocache $LD_PRELOAD"
else if [ "$1" = "-n" ]; then
export LD_PRELOAD="$libnocache" export NOCACHE_NR_FADVISE="$2"
shift 2
fi fi
exec "$@" exec "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment