add freebsd support

add freebsd support
fix a clang warning