make it work on non-BSD-ish systems

Fixes #199