Project

General

Profile

Actions

Bug #580

closed

compilation breaks on gnu/hurd

Added by Anonymous about 18 years ago. Updated over 15 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

compilations fails on (Debian) GNU/Hurd. There is 2 problems :

- PATH_MAX is not defined (PATH_MAX "seems to not be POSIX", that's why it's not present on Hurd)

- UIO_MAXIOV nor IOV_MAX are not defined, but writev is defined (workaround is to define a value for UIO_MAXIOV)

and :

- GNU/hurd defines sendfile() with the same signature as on Linux, maybe it can be used too.

here is a patch which make lighttpd work on GNU/Hurd:


diff -Naur lighttpd-1.4.10.orig/src/configfile.c lighttpd-1.4.10/src/configfile.c
--- lighttpd-1.4.10.orig/src/configfile.c    2006-02-08 13:39:29.000000000 +0100
+++ lighttpd-1.4.10/src/configfile.c    2006-03-15 15:32:12.000000000 +0100
@@ -863,8 +863,12 @@
     int ret;
     buffer *source;
     buffer *out;
+#ifdef PATH_MAX
     char oldpwd[PATH_MAX];
-
+#else
+    char oldpwd[4096];
+#endif
+    
     if (NULL == getcwd(oldpwd, sizeof(oldpwd))) {
         log_error_write(srv, __FILE__, __LINE__, "s", 
                 "cannot get cwd", strerror(errno));
diff -Naur lighttpd-1.4.10.orig/src/network_writev.c lighttpd-1.4.10/src/network_writev.c
--- lighttpd-1.4.10.orig/src/network_writev.c    2006-02-01 12:37:29.000000000 +0100
+++ lighttpd-1.4.10/src/network_writev.c    2006-03-15 15:32:58.000000000 +0100
@@ -42,6 +42,9 @@
 #  endif
 # elif defined(IOV_MAX)
 #  define UIO_MAXIOV IOV_MAX
+# elif defined(__GNU__)
+/* GNU/hurd doesn't define UIO_MAXIOV nor IOV_MAX then falling back to an usable value */
+#  define UIO_MAXIOV 16
 # else
 #  error UIO_MAXIOV nor IOV_MAX are defined
 # endif

thx

-- kolter+dev


Files

Actions #1

Updated by Anonymous almost 17 years ago

monika g?ód p

Actions #2

Updated by stbuehler about 16 years ago

Ok, i agree lighty shouldn't rely on PATH_MAX.

But the posix manpage for writev is pretty clear: http://www.opengroup.org/onlinepubs/007908775/xsh/write.html - IOV_MAX should be defined by limits.h (where it is listed as an extensions, ok; but i think writev depends on this extension)

Actions #3

Updated by stbuehler over 15 years ago

  • Status changed from New to Fixed
  • Resolution set to fixed

Fixed in r2161

Actions

Also available in: Atom