[Network] Close POSIX socket descriptors through sceNetSocketClose

Co-authored-by: Sekai <140012992+SekaixX@users.noreply.github.com>
This commit is contained in:
ParantezTech 2026-10-08 17:28:22 +03:00
parent 53f233da9b
commit ea1dcbcea1
1 changed files with 6 additions and 0 deletions

View File

@ -234,6 +234,12 @@ public static class NetExports
public static int NetSocketClose(CpuContext ctx)
{
var id = unchecked((int)ctx[CpuRegister.Rdi]);
if (KernelSocketCompatExports.TryCloseSocketFd(id))
{
TraceNet("socket.close.posix", id, 0, 0, 0);
return ctx.SetReturn(0);
}
if (!_sockets.TryRemove(id, out var socket))
{
return SetNetError(ctx, NetErrorBadFileDescriptor, NetErrnoBadFileDescriptor);