summaryrefslogtreecommitdiff
path: root/include/sys/socket.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-12 00:22:29 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-12 00:22:29 -0500
commit0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 (patch)
tree6eaef0d8a720fa3da580de87b647fff796fe80b3 /include/sys/socket.h
downloadmusl-0b44a0315b47dd8eced9f3b7f31580cf14bbfc01.tar.gz
musl-0b44a0315b47dd8eced9f3b7f31580cf14bbfc01.tar.bz2
musl-0b44a0315b47dd8eced9f3b7f31580cf14bbfc01.tar.xz
musl-0b44a0315b47dd8eced9f3b7f31580cf14bbfc01.zip
initial check-in, version 0.5.0v0.5.0
Diffstat (limited to 'include/sys/socket.h')
-rw-r--r--include/sys/socket.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/sys/socket.h b/include/sys/socket.h
new file mode 100644
index 00000000..78c93056
--- /dev/null
+++ b/include/sys/socket.h
@@ -0,0 +1,64 @@
+#ifndef _SYS_SOCKET_H
+#define _SYS_SOCKET_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define __NEED_socklen_t
+#define __NEED_sa_family_t
+#define __NEED_size_t
+#define __NEED_ssize_t
+#define __NEED_uid_t
+#define __NEED_pid_t
+#define __NEED_gid_t
+
+#include <bits/alltypes.h>
+
+#include <bits/socket.h>
+
+struct sockaddr
+{
+ sa_family_t sa_family;
+ char sa_data[14];
+};
+
+struct sockaddr_storage
+{
+ sa_family_t ss_family;
+ long long __ss_align;
+ char __ss_padding[128 - sizeof(sa_family_t) - sizeof(long long)];
+};
+
+int socket (int, int, int);
+int socketpair (int, int, int, int [2]);
+
+int shutdown (int, int);
+
+int bind (int, const struct sockaddr *, socklen_t);
+int connect (int, const struct sockaddr *, socklen_t);
+int listen (int, int);
+int accept (int, struct sockaddr *, socklen_t *);
+
+int getsockname (int, struct sockaddr *, socklen_t *);
+int getpeername (int, struct sockaddr *, socklen_t *);
+
+ssize_t send (int, const void *, size_t, int);
+ssize_t recv (int, void *, size_t, int);
+ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
+ssize_t recvfrom (int, void *, size_t, int, struct sockaddr *, socklen_t *);
+ssize_t sendmsg (int, const struct msghdr *, int);
+ssize_t recvmsg (int, struct msghdr *, int);
+
+int getsockopt (int, int, int, void *, socklen_t *);
+int setsockopt (int, int, int, const void *, socklen_t);
+
+int sockatmark (int);
+
+#define SHUT_RD 0
+#define SHUT_WR 1
+#define SHUT_RDWR 2
+
+#ifdef __cplusplus
+}
+#endif
+#endif