split out bsd syscalls and ffifunctions, towards #125