aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-10-06 14:07:41 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-10-06 14:07:41 -0700
commit1b81b2562f3913f2d4fda5bd3a002430b51e0de4 (patch)
treecb08cc75e3a53d1c60c7a7f9e421094fdd316245
parentc7e10b85b5e48322352edf631e6c450070f50dfd (diff)
net-related headers
-rw-r--r--system/include/net/arpa/inet.h6
-rw-r--r--system/include/net/netdb.h2
-rw-r--r--system/include/net/netinet/in.h24
-rw-r--r--system/include/poll.h3
-rw-r--r--system/include/sys/socket.h14
-rw-r--r--tools/shared.py1
6 files changed, 49 insertions, 1 deletions
diff --git a/system/include/net/arpa/inet.h b/system/include/net/arpa/inet.h
new file mode 100644
index 00000000..2cc6f45a
--- /dev/null
+++ b/system/include/net/arpa/inet.h
@@ -0,0 +1,6 @@
+/* */
+
+uint32_t ntohl(uint32_t netlong);
+
+uint16_t ntohs(uint16_t netshort);
+
diff --git a/system/include/net/netdb.h b/system/include/net/netdb.h
new file mode 100644
index 00000000..27ce5b22
--- /dev/null
+++ b/system/include/net/netdb.h
@@ -0,0 +1,2 @@
+/* */
+
diff --git a/system/include/net/netinet/in.h b/system/include/net/netinet/in.h
new file mode 100644
index 00000000..57576236
--- /dev/null
+++ b/system/include/net/netinet/in.h
@@ -0,0 +1,24 @@
+
+struct in_addr {
+ unsigned long s_addr;
+};
+
+struct sockaddr_in {
+ short sin_family;
+ unsigned short sin_port;
+ struct in_addr sin_addr;
+ char sin_zero[8];
+};
+
+struct in6_addr {
+ unsigned char s6_addr[16];
+};
+
+struct sockaddr_in6 {
+ short sin6_family;
+ short sin6_port;
+ int sin6_flowinfo;
+ struct in6_addr sin6_addr;
+ int sin6_scope_id;
+};
+
diff --git a/system/include/poll.h b/system/include/poll.h
index 230f93c6..63c02b90 100644
--- a/system/include/poll.h
+++ b/system/include/poll.h
@@ -7,6 +7,7 @@ extern "C" {
#define POLLOUT 2
#define POLLNVAL 4
#define POLLERR 8
+#define POLLHUP 16
struct pollfd {
int fd;
@@ -14,7 +15,7 @@ struct pollfd {
short revents;
};
-int poll(pollfd *data, int num, int extra);
+int poll(struct pollfd *data, int num, int extra);
#ifdef __cplusplus
}
diff --git a/system/include/sys/socket.h b/system/include/sys/socket.h
new file mode 100644
index 00000000..9795c654
--- /dev/null
+++ b/system/include/sys/socket.h
@@ -0,0 +1,14 @@
+/* */
+
+typedef int socklen_t;
+
+typedef unsigned int sa_family_t;
+#define AF_INET 1
+#define AF_INET6 6
+
+struct sockaddr {
+ sa_family_t sa_family;
+ char sa_data[];
+};
+
+
diff --git a/tools/shared.py b/tools/shared.py
index ae1ca94b..ce2dff14 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -37,6 +37,7 @@ if USE_EMSDK:
'-I' + path_from_root('system', 'include', 'freebsd'), # posix stuff
'-I' + path_from_root('system', 'include', 'libc'),
'-I' + path_from_root('system', 'include', 'libcxx'),
+ '-I' + path_from_root('system', 'include', 'net'),
]
# Engine tweaks