MAXNAMLEN is defined in sys/param.h

--- a/src/getsdir.c	2011-02-14 11:07:00.000000000 +0100
+++ b/src/getsdir.c	2015-06-22 02:47:36.263541750 +0200
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/param.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
