[patch] GNU/Hurd fixes
Samuel Thibault
samuel.thibault at ens-lyon.org
Sun Nov 10 19:24:29 UTC 2019
Hello,
Ondřej Surý, le dim. 10 nov. 2019 18:26:01 +0100, a ecrit:
> thanks for the patch. Two remarks - if you don’t mind, submitting patches via gitlab.isc.org is generally preferred,
This should be specified on the isc website then :) On
https://www.isc.org/bind/ I only found about the mailing list.
> I just have to increase a project limit for new contributors.
I can't click "Fork" there to be able to submit MRs indeed. In the
meanwhile, here is an updated patch.
> For the patch - I would prefer to have this stuff in lib/isc/include/platform.h(.in) and include the header instead of scattering the defines all over the place.
Ok, done so here.
Samuel
-------------- next part --------------
diff --git a/bin/dnssec/dnssectool.h b/bin/dnssec/dnssectool.h
index 3e88e2959e..4ba56d10e0 100644
--- a/bin/dnssec/dnssectool.h
+++ b/bin/dnssec/dnssectool.h
@@ -17,14 +17,11 @@
#include <stdbool.h>
#include <isc/log.h>
+#include <isc/platform.h>
#include <isc/stdtime.h>
#include <dns/rdatastruct.h>
#include <dst/dst.h>
-#ifndef PATH_MAX
-#define PATH_MAX 1024 /* WIN32, and others don't define this. */
-#endif
-
/*! verbosity: set by -v and -q option in each program, defined in dnssectool.c */
extern int verbose;
extern bool quiet;
diff --git a/bin/named/server.c b/bin/named/server.c
index bf4f4a0ebc..337471dd9d 100644
--- a/bin/named/server.c
+++ b/bin/named/server.c
@@ -136,10 +136,6 @@
#define dumpzone dumpzone_file
#endif /* HAVE_LMDB */
-#ifndef PATH_MAX
-#define PATH_MAX 1024
-#endif
-
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t)-1)
#endif
diff --git a/lib/dns/gen.c b/lib/dns/gen.c
index 201429f132..99f0395b3a 100644
--- a/lib/dns/gen.c
+++ b/lib/dns/gen.c
@@ -26,6 +26,8 @@
#include <sys/types.h>
+#include <isc/platform.h>
+
#include <ctype.h>
#include <limits.h>
#include <stdint.h>
@@ -142,10 +144,6 @@ static const char copyright[] =
#define TYPECLASSFMT "%" STR(TYPECLASSLEN) "[-0-9a-z]_%d"
#define ATTRIBUTESIZE 256
-#ifndef PATH_MAX
-#define PATH_MAX 1024
-#endif
-
static struct cc {
struct cc *next;
int rdclass;
diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in
index 90b9a2ee36..0a16b88739 100644
--- a/lib/isc/include/isc/platform.h.in
+++ b/lib/isc/include/isc/platform.h.in
@@ -32,6 +32,24 @@
#define ISC_STRERRORSIZE 128
+/***
+ *** System limitations
+ ***/
+
+#include <limits.h>
+
+#ifndef NAME_MAX
+#define NAME_MAX 256
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+#ifndef IOV_MAX
+#define IOV_MAX 1024
+#endif
+
/***
*** Miscellaneous.
***/
diff --git a/lib/isc/log.c b/lib/isc/log.c
index 6e825a78b0..0af599f8c2 100644
--- a/lib/isc/log.c
+++ b/lib/isc/log.c
@@ -25,6 +25,7 @@
#include <isc/log.h>
#include <isc/magic.h>
#include <isc/mem.h>
+#include <isc/platform.h>
#include <isc/print.h>
#include <isc/stat.h>
#include <isc/stdio.h>
@@ -43,10 +44,6 @@
*/
#define LOG_BUFFER_SIZE (8 * 1024)
-#ifndef PATH_MAX
-#define PATH_MAX 1024 /* WIN32 and others don't define this. */
-#endif
-
/*!
* This is the structure that holds each named channel. A simple linked
* list chains all of the channels together, so an individual channel is
diff --git a/lib/isc/unix/file.c b/lib/isc/unix/file.c
index 65aebdf24f..d2f24825a9 100644
--- a/lib/isc/unix/file.c
+++ b/lib/isc/unix/file.c
@@ -63,6 +63,7 @@
#include <isc/log.h>
#include <isc/md.h>
#include <isc/mem.h>
+#include <isc/platform.h>
#include <isc/print.h>
#include <isc/random.h>
#include <isc/string.h>
@@ -696,9 +697,6 @@ isc_file_munmap(void *addr, size_t len) {
}
#define DISALLOW "\\/ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-#ifndef PATH_MAX
-#define PATH_MAX 1024
-#endif
static isc_result_t
digest2hex(unsigned char *digest, unsigned int digestlen,
diff --git a/lib/isc/unix/include/isc/dir.h b/lib/isc/unix/include/isc/dir.h
index 5a147b89f3..67607970f3 100644
--- a/lib/isc/unix/include/isc/dir.h
+++ b/lib/isc/unix/include/isc/dir.h
@@ -18,16 +18,9 @@
#include <dirent.h>
#include <isc/lang.h>
+#include <isc/platform.h>
#include <isc/result.h>
-#ifndef NAME_MAX
-#define NAME_MAX 256
-#endif
-
-#ifndef PATH_MAX
-#define PATH_MAX 1024
-#endif
-
/*% Directory Entry */
typedef struct isc_direntry {
char name[NAME_MAX];
More information about the bind-users
mailing list