define _BSD_SOURCE to get proper prototypes on linux