Project

General

Profile

Bug #580

compilation breaks on gnu/hurd

Added by Anonymous over 10 years ago. Updated about 8 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
-
Start date:
Due date:
% Done:

0%

Missing in 1.5.x:

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

Fix-usage-of-PATH_MAX-not-POSIX-580.patch View (1.64 KB) stbuehler, 2008-04-24 20:37

Associated revisions

Revision cbdd9e48 (diff)
Added by stbuehler over 8 years ago

Do not rely on PATH_MAX (POSIX does not require it) (#580)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2161 152afb58-edef-0310-8abb-c4023f1b3aa9

History

#1 Updated by Anonymous over 9 years ago

monika g?ód p

#2 Updated by stbuehler over 8 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)

#3 Updated by stbuehler about 8 years ago

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

Fixed in r2161

Also available in: Atom