update to run on BSD and Linux

Signed-off-by: Christopher Hall <hsw@ms2.hinet.net>