Topics:   Apple   -   Microsoft   -   Linux   -   Unix

Lock N go or part 2 of VDI for home.

As mentioned in VDI for home blog entry I needed to write a small C program that locks some memory and then free it forcing Solaris to push out cached data, and memory being used by executable s. So here it is, it?s been tested and works for me, your mileage may vary, its currently limited to only one command line argument, I?m sure it?s just a few more lines to convert it to many command line variables but I figure I needed to get this out in the world before I forget about it.
It?s based on James Litchfield's blog entry on locking memory found at Locking Memory

Download the code at lockNgo.c

To build, use either cc or gcc

gcc ?o lockNgo.c or cc ?o lockNgo.c

To run you need to be root or granted PRIV_PROC_LOCK_MEMORY privilege as documented in James?s blog above, pass ?h to see arguments that can be used.

NOTE: I am not a professional C coder, nor do I wish to be one, fixes and modifications gladly accepted.

 

More Stories in Unix Admin Corner