--- a/src/sysdeptest.c
+++ b/src/sysdeptest.c
@@ -2,6 +2,7 @@
 /* presence of mkdtemp and mkstemp by whether this links without error. */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 
  int
