Simplified bsd patch to be compatible with glibc. It's easier to just use libbsd with glibc. Size shouldn't be an issue. Signed-off-by: Rosen Penev <rosenp@gmail.com>