Module Name:    src
Committed By:   pooka
Date:           Mon Sep 21 21:50:16 UTC 2015

Modified Files:
        src/lib/librumpuser: rumpuser_port.h
        src/tools/compat: compat_defs.h
        src/usr.bin/make: make.h

Log Message:
Add more compat defs for code compiled for !NetBSD targets.

At least GNU Hurd lacks MAXHOSTNAMELEN/MAXPATHLEN/PATH_MAX, so make sure
those have some arbitrary semi-sane values.

from Robert Millan in PR misc/50166, with some modifications from myself


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/lib/librumpuser/rumpuser_port.h
cvs rdiff -u -r1.102 -r1.103 src/tools/compat/compat_defs.h
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/make/make.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumpuser/rumpuser_port.h
diff -u src/lib/librumpuser/rumpuser_port.h:1.45 src/lib/librumpuser/rumpuser_port.h:1.46
--- src/lib/librumpuser/rumpuser_port.h:1.45	Sun Aug 16 11:37:39 2015
+++ src/lib/librumpuser/rumpuser_port.h	Mon Sep 21 21:50:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser_port.h,v 1.45 2015/08/16 11:37:39 pooka Exp $	*/
+/*	$NetBSD: rumpuser_port.h,v 1.46 2015/09/21 21:50:16 pooka Exp $	*/
 
 #ifndef _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
 #define _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
@@ -314,4 +314,16 @@ do {						\
 #define setprogname(a)
 #endif
 
+/* at least GNU Hurd does not specify various common hardcoded constants */
+#include <limits.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN	4096
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX	MAXPATHLEN
+#endif
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN	256
+#endif
+
 #endif /* _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_ */

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.102 src/tools/compat/compat_defs.h:1.103
--- src/tools/compat/compat_defs.h:1.102	Sun Jul 26 14:01:53 2015
+++ src/tools/compat/compat_defs.h	Mon Sep 21 21:50:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.102 2015/07/26 14:01:53 kamil Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.103 2015/09/21 21:50:16 pooka Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -910,6 +910,13 @@ void *setmode(const char *);
 #define LLONG_MIN ((long long)(~LLONG_MAX))
 #endif
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN	4096
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX	MAXPATHLEN
+#endif
+
 /* <paths.h> */
 
 /* The host's _PATH_BSHELL might be broken, so override it. */
@@ -1149,6 +1156,9 @@ __GEN_ENDIAN_DEC(64, le)
 #ifndef MAXPHYS
 #define MAXPHYS (64 * 1024)
 #endif
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN	256
+#endif
 
 /* XXX needed by makefs; this should be done in a better way */
 #undef btodb

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.95 src/usr.bin/make/make.h:1.96
--- src/usr.bin/make/make.h:1.95	Sun Sep  7 20:55:34 2014
+++ src/usr.bin/make/make.h	Mon Sep 21 21:50:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.95 2014/09/07 20:55:34 joerg Exp $	*/
+/*	$NetBSD: make.h,v 1.96 2015/09/21 21:50:16 pooka Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -503,4 +503,13 @@ int str2Lst_Append(Lst, char *, const ch
 #define MAX(a, b) ((a > b) ? a : b)
 #endif
 
+/* At least GNU/Hurd systems lack hardcoded MAXPATHLEN/PATH_MAX */
+#include <limits.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN	4096
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX	MAXPATHLEN
+#endif
+
 #endif /* _MAKE_H_ */

Reply via email to