Define _POSIX_SOURCE to use fileno function.

Thanks to cyisfor.