Added support for BSD systems.