libuname

libuname is an interpose library that I wrote as a proof of concept. It traps system calls that try to learn certain characteristics of the running system. As such, it is of dubious wisdom, but might be the only practical way to accomplish some tasks.

Usage is fairly simple. Build the library (which should be just make), export the environment variable LIBUNAME (which has seven semi-colon delimited fields), and set LD_PRELOAD to the full path and name of libuname.so.

If you're running Solaris, you can test it with the included program sysinfo, which is a program designed to emulate the behavior of the sysinfo(2) system call. Otherwise, you'll need to use uname(1) to test it.

Basically, this library should only be useful for one or two invocations of a program. For example, it was written in response to a comment on dc.sage wherein some piece of software refused to install because the running version of Solaris was too new. Now, defeating this may or may not be a good idea, depending upon the reasons for the refusal, but in the case that it does need to be overridden, this library is less toxic than making the kernel itself lie (albeit slightly more memory-intensive).

Let me know if you find it useful. It builds for sure on my installations of SPARC Solaris 7 and Intel Linux. I will be happy to make it work on other operating systems or installations, if sufficient details can be provided. Generally, I need to know:

Currently, the build requires GCC, but not GNU Make (although GNU Make will work). I hope to have an OSX build presently. libuname is written in straight C and should not need any vendor add-ons to work.

You can download libuname as a 12K tar.gz: libuname-1.0.0.tar.gz, but you really should look at the license first (which is about 1.5 times as large). libuname is under the GNU GPL, and by downloading it or looking at the source, you agree to respect that license. (This means, among other things, that you understand the distinct lack of warranty; this program is pretty much designed to make your system claim to be another variety altogether, which can have all kinds of astonishing results.) Finally, there is a little more information in the README (5K), including known lossage and possibly unexpected quirks.

If you run into problems or you have suggestions, pop me some email; my email address is bstern at this domain (leave off the "www." for savings).

Enjoy!

Other Free Software from www.bstern.org:
coldspot: a semi-automatic locker for X
ll2xpm: Linux kernel Logos to XPM format
wmeyes: yet another useless dock app
wmwork: a Solaris build patch for time management
yeahlaunch: an auto-hiding desktop menu

[No, there's no screenshot here. There is one, of a sort, in the README, though.]