Define _GNU_SOURCE since fcloseall() is a GNU extension Even the Linux manual page says one should do this, although their headers don't really care about it it seems... However this is necessary on Haiku at least.