move more functions to common code
more freebsd stubs