Skip to content

Commit 3a57e53

Browse files
committed
libuv: fix sendmsg parameter type in NuttX port
Update the libuv NuttX port patch to change sendmsg() parameter from "struct msghdr *msg" to "const struct msghdr *msg" in the NuttX-specific implementation stub. This maintains compatibility after NuttX's socket API was made POSIX-compliant with const-correct parameters. Signed-off-by: guoshichao <guoshichao@xiaomi.com>
1 parent b0b90ac commit 3a57e53

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

system/libuv/0001-libuv-port-for-nuttx.patch

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ index 00000000..298bd2f8
424424
+ return 0;
425425
+ }
426426
+
427-
+ /* Make sure the memory is initiallized to zero using calloc() */
427+
+ /* Make sure the memory is initialized to zero using calloc() */
428428
+ *addresses = uv__calloc(*count, sizeof(**addresses));
429429
+ if (*addresses == NULL) {
430430
+ freeifaddrs(addrs);
@@ -3972,3 +3972,15 @@ diff --color -ur libuv_back/src/unix/thread.c libuv/src/unix/thread.c
39723972
# include <sched.h>
39733973
# define uv__cpu_set_t cpu_set_t
39743974
#elif defined(__FreeBSD__)
3975+
diff --git a/src/unix/nuttx.c b/src/unix/nuttx.c
3976+
index d0e110a..e1c962e 100644
3977+
--- a/src/unix/nuttx.c
3978+
+++ b/src/unix/nuttx.c
3979+
@@ -222,7 +222,7 @@ ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags) {
3980+
return UV_ENOTSUP;
3981+
}
3982+
3983+
-ssize_t sendmsg(int sockfd, struct msghdr *msg, int flags) {
3984+
+ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) {
3985+
return UV_ENOTSUP;
3986+
}

0 commit comments

Comments
 (0)