diff --git a/libserialport_internal.h b/libserialport_internal.h
index 962fc20..bef84b6 100644
--- a/libserialport_internal.h
+++ b/libserialport_internal.h
@@ -18,6 +18,11 @@
* along with this program. If not, see .
*/
+#ifdef __linux__
+#define _BSD_SOURCE // for timeradd, timersub, timercmp
+#define _XOPEN_SOURCE 700 // for readlinkat
+#endif
+
#include
#include
#include