summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-12-19 13:07:37 -0500
committerRich Felker <dalias@aerifal.cx>2012-12-19 13:07:37 -0500
commit5d5ab51862cbd010bdf52dc3b04b0967450bcd1a (patch)
tree41431acff8952340f256f9eda10524fba048a0d2
parent3c4214db727ed6300b34be28a5428b7abd6598df (diff)
parent3159e2fc816f5c56b54f86f38748ba1ff9e18f9f (diff)
downloadmusl-5d5ab51862cbd010bdf52dc3b04b0967450bcd1a.tar.gz
musl-5d5ab51862cbd010bdf52dc3b04b0967450bcd1a.tar.bz2
musl-5d5ab51862cbd010bdf52dc3b04b0967450bcd1a.tar.xz
musl-5d5ab51862cbd010bdf52dc3b04b0967450bcd1a.zip
merge a few fixes by sh4rm4
-rw-r--r--arch/x86_64/bits/signal.h2
-rw-r--r--include/arpa/inet.h1
-rw-r--r--include/link.h19
-rw-r--r--include/sys/socket.h2
-rw-r--r--src/network/inet_network.c11
5 files changed, 34 insertions, 1 deletions
diff --git a/arch/x86_64/bits/signal.h b/arch/x86_64/bits/signal.h
index b4220fe2..71b656b5 100644
--- a/arch/x86_64/bits/signal.h
+++ b/arch/x86_64/bits/signal.h
@@ -20,7 +20,7 @@
#define REG_RSP 15
#define REG_RIP 16
#define REG_EFL 17
-#define REG_CSGFS 18
+#define REG_CSGSFS 18
#define REG_ERR 19
#define REG_TRAPNO 20
#define REG_OLDMASK 21
diff --git a/include/arpa/inet.h b/include/arpa/inet.h
index 92938403..fdc501aa 100644
--- a/include/arpa/inet.h
+++ b/include/arpa/inet.h
@@ -24,6 +24,7 @@ uint32_t ntohl(uint32_t);
uint16_t ntohs(uint16_t);
in_addr_t inet_addr (const char *);
+in_addr_t inet_network (const char *);
char *inet_ntoa (struct in_addr);
int inet_pton (int, const char *__restrict, void *__restrict);
const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t);
diff --git a/include/link.h b/include/link.h
index d5160e7e..c30431e9 100644
--- a/include/link.h
+++ b/include/link.h
@@ -3,6 +3,7 @@
#include <elf.h>
#define __NEED_size_t
+#define __NEED_uint32_t
#include <bits/alltypes.h>
#if UINTPTR_MAX > 0xffffffff
@@ -11,6 +12,9 @@
#define ElfW(type) Elf32_ ## type
#endif
+/* this is the same everywhere except alpha and s390 */
+typedef uint32_t Elf_Symndx;
+
struct dl_phdr_info {
ElfW(Addr) dlpi_addr;
const char *dlpi_name;
@@ -22,6 +26,21 @@ struct dl_phdr_info {
void *dlpi_tls_data;
};
+struct link_map {
+ ElfW(Addr) l_addr;
+ char *l_name;
+ ElfW(Dyn) *l_ld;
+ struct link_map *l_next, *l_prev;
+};
+
+struct r_debug {
+ int r_version;
+ struct link_map *r_map;
+ ElfW(Addr) r_brk;
+ enum { RT_CONSISTENT, RT_ADD, RT_DELETE } r_state;
+ ElfW(Addr) r_ldbase;
+};
+
int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *), void *);
#endif
diff --git a/include/sys/socket.h b/include/sys/socket.h
index f1489186..19b2aa55 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -150,6 +150,8 @@ struct linger
#define SO_SNDLOWAT 19
#define SO_RCVTIMEO 20
#define SO_SNDTIMEO 21
+#define SO_SNDBUFFORCE 32
+#define SO_RCVBUFFORCE 33
#endif
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);
+}