Ticket #580 (new defect)

Opened 2 years ago

Last modified 3 weeks ago

compilation breaks on gnu/hurd

Reported by: kolter+dev@openics.org Assigned to: jan
Priority: normal Milestone:
Component: core Version: 1.4.x-svn
Severity: normal Keywords: patch
Cc: Blocking:
Need Feedback: 0

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

Attachments

Fix-usage-of-PATH_MAX-not-POSIX-580.patch (1.6 kB) - added by stbuehler on 04/24/2008 08:37:56 PM.

Change History

05/19/2007 03:16:22 PM changed by anonymous

monika głód p

04/24/2008 08:37:34 PM changed by stbuehler

  • keywords set to patch.
  • version changed from 1.4.11 to 1.4.x-svn.
  • blocking changed.
  • pending changed.

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)

04/24/2008 08:37:56 PM changed by stbuehler

  • attachment Fix-usage-of-PATH_MAX-not-POSIX-580.patch added.

Add/Change #580 (compilation breaks on gnu/hurd)




Change Properties