1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

Ports: Add libuv

We've had a half-arsed port of libuv inside the cmake port, but let's
just port it properly.
Note that this pins a specific commit (which is currently the latest
commit in their default branch).
This commit is contained in:
Ali Mohammad Pur 2021-07-09 06:29:58 +04:30 committed by Andreas Kling
parent 727403746f
commit fcd56f2172
9 changed files with 483 additions and 0 deletions

View file

@ -0,0 +1,36 @@
From 91c2345d42459232d958eaf0eba5b10786ac3475 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <ali.mpfard@gmail.com>
Date: Fri, 9 Jul 2021 04:59:05 +0430
Subject: [PATCH 4/7] tcp: Don't use SO_LINGER
---
src/unix/tcp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/unix/tcp.c b/src/unix/tcp.c
index bc0fb66..e78259a 100644
--- a/src/unix/tcp.c
+++ b/src/unix/tcp.c
@@ -313,15 +313,19 @@ int uv_tcp_getpeername(const uv_tcp_t* handle,
int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb) {
int fd;
+#ifndef __serenity__
struct linger l = { 1, 0 };
+#endif
/* Disallow setting SO_LINGER to zero due to some platform inconsistencies */
if (handle->flags & UV_HANDLE_SHUTTING)
return UV_EINVAL;
fd = uv__stream_fd(handle);
+#ifndef __serenity__
if (0 != setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(l)))
return UV__ERR(errno);
+#endif
uv_close((uv_handle_t*) handle, close_cb);
return 0;
--
2.32.0