summaryrefslogtreecommitdiff
path: root/Kernel/Net/LocalSocket.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-09-17 13:51:09 -0600
committerAndreas Kling <kling@serenityos.org>2021-01-03 22:12:19 +0100
commitf98ca35b83d521377d4bce5927fdcb4a764ac02e (patch)
tree1fe252ef4d572a3dede621052766fa96ebc4da9d /Kernel/Net/LocalSocket.h
parentb36f57e5705a9db89e267608f9a1f8d9f8f640b8 (diff)
downloadserenity-f98ca35b83d521377d4bce5927fdcb4a764ac02e.zip
Kernel: Improve ProcFS behavior in low memory conditions
When ProcFS could no longer allocate KBuffer objects to serve calls to read, it would just return 0, indicating EOF. This then triggered parsing errors because code assumed it read the file. Because read isn't supposed to return ENOMEM, change ProcFS to populate the file data upon file open or seek to the beginning. This also means that calls to open can now return ENOMEM if needed. This allows the caller to either be able to successfully open the file and read it, or fail to open it in the first place.
Diffstat (limited to 'Kernel/Net/LocalSocket.h')
-rw-r--r--Kernel/Net/LocalSocket.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Net/LocalSocket.h b/Kernel/Net/LocalSocket.h
index f0025cdb14..ab98dd017e 100644
--- a/Kernel/Net/LocalSocket.h
+++ b/Kernel/Net/LocalSocket.h
@@ -56,7 +56,7 @@ public:
virtual KResult listen(size_t) override;
virtual void get_local_address(sockaddr*, socklen_t*) override;
virtual void get_peer_address(sockaddr*, socklen_t*) override;
- virtual void attach(FileDescription&) override;
+ virtual KResult attach(FileDescription&) override;
virtual void detach(FileDescription&) override;
virtual bool can_read(const FileDescription&, size_t) const override;
virtual bool can_write(const FileDescription&, size_t) const override;