From cceac09b0277818da831c12fa4b46632ee516672 Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 7 Jul 2026 02:36:00 -0300 Subject: [PATCH] localsocket: do not wait for connect to complete this matches linux behaviour, where connect() instantly returns and only really happens on a POLLOUT/send() --- kernel-src/io/net/localsocket.c | 25 +------------------------ recipes/astral | 2 +- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/kernel-src/io/net/localsocket.c b/kernel-src/io/net/localsocket.c index 3dcefce8..7ce19a74 100644 --- a/kernel-src/io/net/localsocket.c +++ b/kernel-src/io/net/localsocket.c @@ -896,32 +896,9 @@ static int localsock_connect(socket_t *socket, sockaddr_t *addr, uintmax_t flags binding = NULL; localsocket->pair = pair; - - // if nonblocking, return success. the userspace/whatever will - // poll() the client to know when they can send data or if the server gave up and closed - if (socket_nonblocking(socket, flags)) { - error = 0; - goto leave; - } - - // otherwise, we will just do the same thing as userspace (but here) - polldesc_t desc = {0}; - error = poll_initdesc(&desc, 1); - if (error) - goto leave; - - int revents = internalpoll(socket, &desc.data[0], POLLOUT); - __assert(revents == 0); - - // release and wait. once we return, we will be connected. MUTEX_RELEASE(&pair->mutex); - error = poll_dowait(&desc, localsocket->snd_timeout_us); - if (error == ETIMEDOUT) - error = EAGAIN; - - poll_leave(&desc); - poll_destroydesc(&desc); + error = 0; leave: if (binding) diff --git a/recipes/astral b/recipes/astral index dcb6f436..feae42ce 100644 --- a/recipes/astral +++ b/recipes/astral @@ -1,5 +1,5 @@ name=astral -revision=20 +revision=21 from_source=astral imagedeps="build-essential nasm" hostdeps="xgcc xbinutils limine"