From e0c5ae090c942cd39731090c6780341400f60a76 Mon Sep 17 00:00:00 2001 From: nmzik Date: Sat, 24 Oct 2026 20:14:46 +0200 Subject: [PATCH] kernel: send _write to descriptors 0-2 through KernelWrite instead of dropping it --- src/libs/libKernel.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/libs/libKernel.cpp b/src/libs/libKernel.cpp index c6fb3d76c..81b9ca797 100644 --- a/src/libs/libKernel.cpp +++ b/src/libs/libKernel.cpp @@ -1370,22 +1370,8 @@ static void KYTY_SYSV_ABI KernelRtldSetApplicationHeapAPI(void* api[]) { [[maybe_unused]] auto* heap_posix_memalign = api[6]; } -static int64_t KYTY_SYSV_ABI write(int d, const char* str, int64_t size) { - // PRINT_NAME(); - - EXIT_NOT_IMPLEMENTED(d < 0); - - if (Network::Net::IsSocket(d)) { - return Network::Net::Send(d, str, static_cast(size), 0); - } - - if (d > 2) { - return POSIX_N_CALL(FileSystem::KernelWrite(d, str, size)); - } - - int size_int = static_cast(size); - - return size_int; +static int64_t KYTY_SYSV_ABI write(int d, const void* buf, size_t nbytes) { + return POSIX_N_CALL(FileSystem::KernelWrite(d, buf, nbytes)); } static int KYTY_SYSV_ABI open(const char* path, int flags, int mode) {