Add support for setsize on linux and freebsd