fixed build on *BSD systems