summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/include/sys
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/include/sys')
-rw-r--r--libc-top-half/musl/include/sys/socket.h18
-rw-r--r--libc-top-half/musl/include/sys/stat.h2
2 files changed, 12 insertions, 8 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
diff --git a/libc-top-half/musl/include/sys/stat.h b/libc-top-half/musl/include/sys/stat.h
index 72e1626..c0090f7 100644
--- a/libc-top-half/musl/include/sys/stat.h
+++ b/libc-top-half/musl/include/sys/stat.h
@@ -78,11 +78,9 @@ int stat(const char *__restrict, struct stat *__restrict);
int fstat(int, struct stat *);
int lstat(const char *__restrict, struct stat *__restrict);
int fstatat(int, const char *__restrict, struct stat *__restrict, int);
-#ifdef __wasilibc_unmodified_upstream /* WASI has no chmod */
int chmod(const char *, mode_t);
int fchmod(int, mode_t);
int fchmodat(int, const char *, mode_t, int);
-#endif
#ifdef __wasilibc_unmodified_upstream /* WASI has no umask */
mode_t umask(mode_t);
#endif