net: report open file and device descriptors ready in select (Cyberpunk 2077 Galaxy RNG seeding)

Co-authored-by: Artyom Zabroda <artyomzabroda@proton.me>
This commit is contained in:
nmzik
2026-10-22 17:02:46 +02:00
parent f5f4e7d48a
commit a875d1b205
4 changed files with 40 additions and 1 deletions
+5
View File
@@ -410,6 +410,11 @@ std::filesystem::path GetRealFilename(const std::string& mounted_file_name) {
return g_mount_points->ResolvePath(mounted_file_name);
}
bool IsOpenDescriptor(int d) {
const auto* file = g_files->GetFile(d);
return file != nullptr && file->opened;
}
// NOLINTNEXTLINE(readability-function-cognitive-complexity)
int KYTY_SYSV_ABI KernelOpen(const char* path, int flags, uint16_t mode) {
PRINT_NAME();
+2
View File
@@ -56,6 +56,8 @@ void Mount(const std::filesystem::path& folder, const std::stri
void Umount(const std::string& folder_or_point);
// Returns an empty path when the guest path has no mounted filesystem.
std::filesystem::path GetRealFilename(const std::string& mounted_file_name);
// Returns whether d is an open file, directory or device descriptor.
bool IsOpenDescriptor(int d);
int KYTY_SYSV_ABI KernelOpen(const char* path, int flags, uint16_t mode);
int KYTY_SYSV_ABI KernelClose(int d);