added _BSD_SOURCE for linux to solve some lingering compile issues