aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArlo Breault <arlolra@gmail.com>2013-04-03 19:25:52 -0700
committerArlo Breault <arlolra@gmail.com>2013-04-08 17:20:08 -0700
commitecaaf7a4992ec0d949d3e226e2bd6427009dd6a6 (patch)
treee0735658b5cd90a293f61d13698ec570a817050e
parent94ef129de4fa1abff153086d7c5c22b3adffae34 (diff)
combine netdb.h
-rw-r--r--AUTHORS2
-rw-r--r--system/include/net/netdb.h40
-rw-r--r--system/include/netdb.h26
-rw-r--r--system/include/sys/socket.h2
4 files changed, 25 insertions, 45 deletions
diff --git a/AUTHORS b/AUTHORS
index b6770265..d7b146e1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -58,3 +58,5 @@ a license to everyone to use it as detailed in LICENSE.)
* Felix H. Dahlke <fhd@ubercode.de>
* Éloi Rivard <azmeuk@gmail.com>
* Alexander Gladysh <ag@logiceditor.com>
+* Arlo Breault <arlolra@gmail.com>
+
diff --git a/system/include/net/netdb.h b/system/include/net/netdb.h
deleted file mode 100644
index 4151ccb5..00000000
--- a/system/include/net/netdb.h
+++ /dev/null
@@ -1,40 +0,0 @@
-
-#ifndef _NET_NETDB_H
-#define _NET_NETDB_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct addrinfo
-{
- int ai_flags;
- int ai_family;
- int ai_socktype;
- int ai_protocol;
- socklen_t ai_addrlen;
- struct sockaddr *ai_addr;
- char *ai_canonname;
- struct addrinfo *ai_next;
-};
-
-extern int getaddrinfo(const char *name, const char *service, const struct addrinfo *req, struct addrinfo **pai);
-extern void freeaddrinfo(struct addrinfo *ai);
-extern int getnameinfo (struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, unsigned int flags);
-const char *gai_strerror(int ecode);
-
-struct hostent
-{
- char *h_name;
- char **h_aliases;
- int h_addrtype;
- int h_length;
- char **h_addr_list;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/system/include/netdb.h b/system/include/netdb.h
index 6e069448..ac51bcb7 100644
--- a/system/include/netdb.h
+++ b/system/include/netdb.h
@@ -33,12 +33,30 @@ extern "C" {
typedef int socklen_t;
-struct hostent {
- char* h_name;
- char** h_aliases;
+struct addrinfo
+{
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+ socklen_t ai_addrlen;
+ struct sockaddr *ai_addr;
+ char *ai_canonname;
+ struct addrinfo *ai_next;
+};
+
+extern int getaddrinfo(const char *name, const char *service, const struct addrinfo *req, struct addrinfo **pai);
+extern void freeaddrinfo(struct addrinfo *ai);
+extern int getnameinfo (struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, unsigned int flags);
+const char *gai_strerror(int ecode);
+
+struct hostent
+{
+ char *h_name;
+ char **h_aliases;
int h_addrtype;
int h_length;
- char** h_addr_list;
+ char **h_addr_list;
};
#define h_addr h_addr_list[0]
diff --git a/system/include/sys/socket.h b/system/include/sys/socket.h
index e9b6c770..d0b3ebf4 100644
--- a/system/include/sys/socket.h
+++ b/system/include/sys/socket.h
@@ -17,7 +17,7 @@ extern "C" {
#define SO_BROADCAST 6
#define AF_UNIX PF_UNIX
-#define AF_UNSPEC 100
+#define AF_UNSPEC 0
#define SOCK_STREAM 200
#define SOL_SOCKET 50
#define SO_ERROR 10