diff -Paur --no-dereference -- libpng.upstream/contrib/libtests/timepng.c libpng/contrib/libtests/timepng.c
--- libpng.upstream/contrib/libtests/timepng.c
+++ libpng/contrib/libtests/timepng.c
@@ -21,6 +21,10 @@
 #include <errno.h>
 #include <limits.h>
 
+#if !defined(FILENAME_MAX) && defined(__sortix__)
+#define FILENAME_MAX 256
+#endif
+
 #include <time.h>
 
 #if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
diff -Paur --no-dereference -- libpng.upstream/contrib/tools/pngcp.c libpng/contrib/tools/pngcp.c
--- libpng.upstream/contrib/tools/pngcp.c
+++ libpng/contrib/tools/pngcp.c
@@ -73,6 +73,10 @@
 #include <limits.h>
 #include <assert.h>
 
+#if !defined(FILENAME_MAX) && defined(__sortix__)
+#define FILENAME_MAX 256
+#endif
+
 #include <unistd.h>
 #include <sys/stat.h>
 
diff -Paur --no-dereference -- libpng.upstream/contrib/tools/pngfix.c libpng/contrib/tools/pngfix.c
--- libpng.upstream/contrib/tools/pngfix.c
+++ libpng/contrib/tools/pngfix.c
@@ -18,6 +18,10 @@
 #include <errno.h>
 #include <assert.h>
 
+#if !defined(FILENAME_MAX) && defined(__sortix__)
+#define FILENAME_MAX 256
+#endif
+
 #define implies(x,y) assert(!(x) || (y))
 
 #ifdef __GNUC__
