// gcc -o cache_clear cache_clear.c; chmod u+s cache_clear #include #include int main(int argc, char** argv) { FILE *f; printf("uid=%d\n", geteuid()); if((f = fopen("/proc/sys/vm/drop_caches","w")) == NULL) printf("Cannot open input file: /proc/sys/vm/drop_caches \n"); printf("sync \n"); system("sync"); printf("echo 1 > /proc/sys/vm/drop_caches \n"); fprintf(f,"1\n"); return 0; }