aboutsummaryrefslogtreecommitdiff
path: root/include/netdb.h
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2016-05-30 13:37:11 +0000
committerEd Schouten <ed@FreeBSD.org>2016-05-30 13:37:11 +0000
commit07acf54b4bad4abba3192c032d28c863ca874bb2 (patch)
tree71072d5dba6e204dda38a08ab248f79c1699154b /include/netdb.h
parent7b7f31e6cfabda76b663c38a1333453c533ff0d3 (diff)
downloadsrc-07acf54b4bad4abba3192c032d28c863ca874bb2.tar.gz
src-07acf54b4bad4abba3192c032d28c863ca874bb2.zip
Add missing types and constants to <netdb.h>.
According to POSIX, the netdb.h header must also provide in_addr_t and in_port_t. It should also provide IPPORT_RESERVED. Copy over the necessary bits from <netinet/in.h> to achieve that.
Notes
Notes: svn path=/head/; revision=300996
Diffstat (limited to 'include/netdb.h')
-rw-r--r--include/netdb.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/netdb.h b/include/netdb.h
index a73d2afadb45..3fa5ff3763e7 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -60,6 +60,16 @@
#include <sys/cdefs.h>
#include <sys/_types.h>
+#ifndef _IN_ADDR_T_DECLARED
+typedef __uint32_t in_addr_t;
+#define _IN_ADDR_T_DECLARED
+#endif
+
+#ifndef _IN_PORT_T_DECLARED
+typedef __uint16_t in_port_t;
+#define _IN_PORT_T_DECLARED
+#endif
+
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
@@ -131,6 +141,8 @@ struct addrinfo {
struct addrinfo *ai_next; /* next structure in linked list */
};
+#define IPPORT_RESERVED 1024
+
/*
* Error return codes from gethostbyname() and gethostbyaddr()
* (left in h_errno).