about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2012-12-19 07:32:38 +0100
committerrofl0r <retnyg@gmx.net>2012-12-19 07:32:38 +0100
commit36d7303878a8827b706317383fc218529f432143 (patch)
treee0cbd314a58fe477d833f1538c39a08b41514028 /src
parent3bb167b33818b3ac569f73a2ff82ff1ab3b04c4a (diff)
downloadmusl-36d7303878a8827b706317383fc218529f432143.tar.gz
musl-36d7303878a8827b706317383fc218529f432143.tar.xz
musl-36d7303878a8827b706317383fc218529f432143.zip
add inet_network (required for wine)
Diffstat (limited to 'src')
-rw-r--r--src/network/inet_network.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/network/inet_network.c b/src/network/inet_network.c
new file mode 100644
index 00000000..ae60d7f6
--- /dev/null
+++ b/src/network/inet_network.c
@@ -0,0 +1,11 @@
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include "__dns.h"
+
+in_addr_t inet_network(const char *p)
+{
+        struct sockaddr_in sin;
+        if (__ipparse(&sin, AF_INET, p)) return -1;
+        return ntohl(sin.sin_addr.s_addr);
+}