--- src/tds/tls.c.orig 2015-05-10 16:53:53.649667739 +0600 +++ src/tds/tls.c 2015-05-10 17:04:29.479624026 +0600 @@ -46,6 +46,10 @@ #include #endif /* HAVE_SYS_STAT_H */ +#if defined(__FreeBSD__) || defined(__DragonFly__) +#include +#endif + #include #include #include