/* * Copyright (c) 2018-2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include namespace Kernel { using BlockFlags = Thread::FileBlocker::BlockFlags; KResultOr Process::sys$select(Userspace user_params) { VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); Syscall::SC_select_params params {}; if (!copy_from_user(¶ms, user_params)) return EFAULT; if (params.nfds < 0) return EINVAL; Thread::BlockTimeout timeout; if (params.timeout) { Optional