From 5f71bf0cc7de17d0aa2703aabf4e0cad5f000ae8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 28 Mar 2021 17:50:08 +0200 Subject: Kernel+LibC: Implement sys$ioctl() FIONBIO This is another (older) way of making a file descriptor non-blocking. --- Kernel/Syscalls/ioctl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Kernel/Syscalls/ioctl.cpp') diff --git a/Kernel/Syscalls/ioctl.cpp b/Kernel/Syscalls/ioctl.cpp index 2d06bffa34..acff91dfd1 100644 --- a/Kernel/Syscalls/ioctl.cpp +++ b/Kernel/Syscalls/ioctl.cpp @@ -26,6 +26,7 @@ #include #include +#include namespace Kernel { @@ -34,6 +35,10 @@ KResultOr Process::sys$ioctl(int fd, unsigned request, FlatPtr arg) auto description = file_description(fd); if (!description) return EBADF; + if (request == FIONBIO && arg != 0) { + description->set_blocking(false); + return KSuccess; + } return description->file().ioctl(*description, request, arg); } -- cgit v1.2.3