Browse Source

Kernel: Handle fstat() on sockets

Sergey Bugaev 5 years ago
parent
commit
8aef0a0755
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Kernel/FileSystem/FileDescription.cpp

+ 5 - 0
Kernel/FileSystem/FileDescription.cpp

@@ -54,6 +54,11 @@ KResult FileDescription::fstat(stat& buffer)
         buffer.st_mode = 001000;
         return KSuccess;
     }
+    if (is_socket()) {
+        memset(&buffer, 0, sizeof(buffer));
+        buffer.st_mode = 0140000;
+        return KSuccess;
+    }
 
     if (!m_inode)
         return KResult(-EBADF);