summaryrefslogtreecommitdiffstats
path: root/libc-bottom-half/headers/public/__header_sys_socket.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 16:08:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 16:08:04 +0000
commit41927c28dd5030318be5cf71f515449d55b2802b (patch)
tree41f7cef3a417fee1ee171cdb4f2709f4372ae4f3 /libc-bottom-half/headers/public/__header_sys_socket.h
parentReleasing progress-linux version 0.0~git20230821.ec4566b-2~progress7.99u1. (diff)
downloadwasi-libc-41927c28dd5030318be5cf71f515449d55b2802b.tar.xz
wasi-libc-41927c28dd5030318be5cf71f515449d55b2802b.zip
Merging upstream version 0.0~git20240411.9e8c542.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-bottom-half/headers/public/__header_sys_socket.h')
-rw-r--r--libc-bottom-half/headers/public/__header_sys_socket.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/libc-bottom-half/headers/public/__header_sys_socket.h b/libc-bottom-half/headers/public/__header_sys_socket.h
index 8ba4eff..fa98cca 100644
--- a/libc-bottom-half/headers/public/__header_sys_socket.h
+++ b/libc-bottom-half/headers/public/__header_sys_socket.h
@@ -1,6 +1,7 @@
#ifndef __wasilibc___header_sys_socket_h
#define __wasilibc___header_sys_socket_h
+#include <__wasi_snapshot.h>
#include <__struct_msghdr.h>
#include <__struct_sockaddr.h>
#include <__struct_sockaddr_storage.h>
@@ -11,9 +12,42 @@
#define SHUT_WR __WASI_SDFLAGS_WR
#define SHUT_RDWR (SHUT_RD | SHUT_WR)
+#ifdef __wasilibc_use_wasip2
+#define MSG_DONTWAIT 0x0040
+#define MSG_NOSIGNAL 0x4000
+#define MSG_PEEK 0x0002
+#define MSG_WAITALL 0x0100
+#define MSG_TRUNC 0x0020
+
+#define SOL_IP 0
+#define SOL_TCP 6
+#define SOL_UDP 17
+#define SOL_IPV6 41
+
+#define SOMAXCONN 128
+
+#define SO_REUSEADDR 2
+#define SO_ERROR 4
+#define SO_SNDBUF 7
+#define SO_RCVBUF 8
+#define SO_KEEPALIVE 9
+#define SO_ACCEPTCONN 30
+#define SO_PROTOCOL 38
+#define SO_DOMAIN 39
+
+#if __LONG_MAX == 0x7fffffff
+#define SO_RCVTIMEO 66
+#define SO_SNDTIMEO 67
+#else
+#define SO_RCVTIMEO 20
+#define SO_SNDTIMEO 21
+#endif
+
+#else // __wasilibc_use_wasip2
#define MSG_PEEK __WASI_RIFLAGS_RECV_PEEK
#define MSG_WAITALL __WASI_RIFLAGS_RECV_WAITALL
#define MSG_TRUNC __WASI_ROFLAGS_RECV_DATA_TRUNCATED
+#endif // __wasilibc_use_wasip2
#define SOCK_DGRAM __WASI_FILETYPE_SOCKET_DGRAM
#define SOCK_STREAM __WASI_FILETYPE_SOCKET_STREAM