summaryrefslogtreecommitdiff
path: root/Kernel/Devices/RandomDevice.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-29 13:58:40 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-29 13:58:40 +0200
commit8cbb7f101f1d7d8cf71a9347ddf3a6ca46a97b11 (patch)
tree75257c71c207ff7910aafd89517c0e31aa970e32 /Kernel/Devices/RandomDevice.cpp
parent3761bc3ed7bc245e5ba4119136e6e33698b30300 (diff)
downloadserenity-8cbb7f101f1d7d8cf71a9347ddf3a6ca46a97b11.zip
Kernel: Have File virtuals take a FileDescriptor& rather than a Process&.
This will allow us to implement different behaviors depending on the role of the descriptor a File is being accessed through.
Diffstat (limited to 'Kernel/Devices/RandomDevice.cpp')
-rw-r--r--Kernel/Devices/RandomDevice.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Devices/RandomDevice.cpp b/Kernel/Devices/RandomDevice.cpp
index 25d9159dd2..354212fbcd 100644
--- a/Kernel/Devices/RandomDevice.cpp
+++ b/Kernel/Devices/RandomDevice.cpp
@@ -26,12 +26,12 @@ static void mysrand(unsigned seed)
}
#endif
-bool RandomDevice::can_read(Process&) const
+bool RandomDevice::can_read(FileDescriptor&) const
{
return true;
}
-ssize_t RandomDevice::read(Process&, byte* buffer, ssize_t size)
+ssize_t RandomDevice::read(FileDescriptor&, byte* buffer, ssize_t size)
{
const int range = 'z' - 'a';
ssize_t nread = min(size, PAGE_SIZE);
@@ -42,7 +42,7 @@ ssize_t RandomDevice::read(Process&, byte* buffer, ssize_t size)
return nread;
}
-ssize_t RandomDevice::write(Process&, const byte*, ssize_t size)
+ssize_t RandomDevice::write(FileDescriptor&, const byte*, ssize_t size)
{
// FIXME: Use input for entropy? I guess that could be a neat feature?
return min(PAGE_SIZE, size);