summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/include/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-top-half/musl/include/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-top-half/musl/include/sys/socket.h')
-rw-r--r--libc-top-half/musl/include/sys/socket.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/libc-top-half/musl/include/sys/socket.h b/libc-top-half/musl/include/sys/socket.h
index 4d574c6..29189e3 100644
--- a/libc-top-half/musl/include/sys/socket.h
+++ b/libc-top-half/musl/include/sys/socket.h
@@ -1,5 +1,8 @@
#ifndef _SYS_SOCKET_H
#define _SYS_SOCKET_H
+
+#include <__wasi_snapshot.h>
+
#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
#else
#include <__header_sys_socket.h>
@@ -395,30 +398,33 @@ struct sockaddr_storage {
#include <__struct_sockaddr_storage.h>
#endif
-#ifdef __wasilibc_unmodified_upstream /* WASI has no socket/socketpair */
+#if (defined __wasilibc_unmodified_upstream) || (defined __wasilibc_use_wasip2)
int socket (int, int, int);
+#endif
+
+#ifdef __wasilibc_unmodified_upstream /* WASI has no socketpair */
int socketpair (int, int, int, int [2]);
#endif
int shutdown (int, int);
-#ifdef __wasilibc_unmodified_upstream /* WASI has no bind/connect/listen/accept */
-int bind (int, const struct sockaddr *, socklen_t);
+#if (defined __wasilibc_unmodified_upstream) || (defined __wasilibc_use_wasip2)
int connect (int, const struct sockaddr *, socklen_t);
+int bind (int, const struct sockaddr *, socklen_t);
int listen (int, int);
#endif
int accept (int, struct sockaddr *__restrict, socklen_t *__restrict);
int accept4(int, struct sockaddr *__restrict, socklen_t *__restrict, int);
-#ifdef __wasilibc_unmodified_upstream /* WASI has no getsockname/getpeername */
+#if (defined __wasilibc_unmodified_upstream) || (defined __wasilibc_use_wasip2)
int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict);
int getpeername (int, struct sockaddr *__restrict, socklen_t *__restrict);
#endif
ssize_t send (int, const void *, size_t, int);
ssize_t recv (int, void *, size_t, int);
-#ifdef __wasilibc_unmodified_upstream /* WASI has no sendto/recvfrom */
+#if (defined __wasilibc_unmodified_upstream) || (defined __wasilibc_use_wasip2)
ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
ssize_t recvfrom (int, void *__restrict, size_t, int, struct sockaddr *__restrict, socklen_t *__restrict);
#endif
@@ -428,7 +434,7 @@ ssize_t recvmsg (int, struct msghdr *, int);
#endif
int getsockopt (int, int, int, void *__restrict, socklen_t *__restrict);
-#ifdef __wasilibc_unmodified_upstream /* WASI has no setsockopt */
+#if (defined __wasilibc_unmodified_upstream) || (defined __wasilibc_use_wasip2)
int setsockopt (int, int, int, const void *, socklen_t);
#endif