here are the patches needed to build Bogofilter under OS/2.
Only real differences are the lack of fcntl(), so there is an emulation code based on native API, and optind must be reset to 0 (instead of 1) to make getopt() to work again (should be the same on other platforms).
Also unlocking the databases before closing is working better (see below).
All tests are ok except for t.lock2: here I see that instances are in an eternal loop, because it is quite hard to lock the two databases; I have an SMP system, and it happens that one process can lock only one db, because the other one is locked by another process.
I think database locking must be made atomical, e.g. using a single file to gain the lock.
I hope to see this patch added to cvs code.