From: Enrico Tassi <gareuselesinge@debian.org>
Date: Sun, 30 Jun 2013 11:42:21 +0200
Subject: Fix build on hurd-i386

See http://www.debian.org/ports/hurd/
---
 ext/posix/posix.c | 5 +++++
 1 file changed, 5 insertions(+)

--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -9,6 +9,9 @@
  * With contributions by Roberto Ierusalimschy.
  * With documentation from Steve Donovan 2012
  */
+#ifdef __GNU__
+#define _GNU_SOURCE
+#endif
 
 #include "ctype.c"
 #include "dirent.c"
--- a/ext/posix/unistd.c
+++ b/ext/posix/unistd.c
@@ -455,6 +455,8 @@
     free(r);
 #else
 	long size = pathconf(".", _PC_PATH_MAX);
+        if (size == -1)
+            return pusherror(L, "pathconf");
 	void *ud;
 	lua_Alloc lalloc;
 	char *b, *r;
