Date: Sat, 19 May 2012 11:00:00 -0000

AI_NUMERICSERV as a value for the `ai_flags' member
of `struct addrinfo' of header <netdb.h> has only
been available since:

  POSIX 1003.1-2008, Issue 7
  glibc 2.3.4
  Mac OS X 10.6
  etc.

Fortunately, its main purpose seems to be only
to optimize calls of `getaddrinfo', and because it
is meant to be a bit flag, it can therefore be
[relatively] safely ignored by defining it to have
the value zero.

Signed-off-by: Michael Witten <mfwit...@gmail.com>
---
 nbd-client.c   |  1 +
 nbd-server.c   |  1 +
 netdb-compat.h | 24 ++++++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 netdb-compat.h

diff --git a/nbd-client.c b/nbd-client.c
index 0e62821..81e0afa 100644
--- a/nbd-client.c
+++ b/nbd-client.c
@@ -28,6 +28,7 @@
 #include <netinet/tcp.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#include "netdb-compat.h"
 #include <stdio.h>
 #include <fcntl.h>
 #include <syslog.h>
diff --git a/nbd-server.c b/nbd-server.c
index f2e611f..2c0e9bb 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -77,6 +77,7 @@
 #include <netinet/tcp.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#include "netdb-compat.h"
 #include <syslog.h>
 #include <unistd.h>
 #include <stdbool.h>
diff --git a/netdb-compat.h b/netdb-compat.h
new file mode 100644
index 0000000..7389ea7
--- /dev/null
+++ b/netdb-compat.h
@@ -0,0 +1,24 @@
+#ifndef NETDB COMPAT_H
+#define NETDB_COMPAT_H
+
+/* AI_NUMERICSERV as a value for the `ai_flags' member
+ * of `struct addrinfo' of header <netdb.h> has only
+ * been available since:
+ *
+ *   POSIX 1003.1-2008, Issue 7
+ *   glibc 2.3.4
+ *   Mac OS X 10.6
+ *   etc.
+ *
+ * Fortunately, its main purpose seems to be only
+ * to optimize calls of `getaddrinfo', and because it
+ * is meant to be a bit flag, it can therefore be
+ * [relatively] safely ignored by defining it to have
+ * the value zero.
+ */
+
+#ifndef AI_NUMERICSERV
+#define AI_NUMERICSERV 0
+#endif
+
+#endif
-- 
1.7.10.2.484.gcd07cc5


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Nbd-general mailing list
Nbd-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to