Use a slightly cleaner hack on BSD systems.