File: nocache.in

package info (click to toggle)
nocache 1.2-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 220 kB
  • sloc: ansic: 744; makefile: 54; sh: 42
file content (17 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

export LD_PRELOAD="##libdir##/nocache.so $LD_PRELOAD"

while getopts "n:D:f" opt; do
case "$opt" in
    n) export NOCACHE_NR_FADVISE="$OPTARG" ;;
    f) export NOCACHE_FLUSHALL=1 ;;
    D) exec {debugfd}>"$OPTARG"
       export NOCACHE_DEBUGFD="$debugfd"
       ;;
esac
done
shift $((OPTIND-1))

[ ! -z "$debugfd" ] && echo "[nocache] DEBUG: Executing: $@" >&$debugfd
exec "$@"