added _GNU_SOURCE and limits.h to build against glibc-2.8