mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
Kernel: Move devices into Kernel/Devices/.
This commit is contained in:
parent
072ea7eece
commit
ab43658c55
42 changed files with 53 additions and 54 deletions
38
Kernel/Devices/NullDevice.cpp
Normal file
38
Kernel/Devices/NullDevice.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
#include "NullDevice.h"
|
||||
#include "Limits.h"
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/kstdio.h>
|
||||
|
||||
static NullDevice* s_the;
|
||||
|
||||
NullDevice& NullDevice::the()
|
||||
{
|
||||
ASSERT(s_the);
|
||||
return *s_the;
|
||||
}
|
||||
|
||||
NullDevice::NullDevice()
|
||||
: CharacterDevice(1, 3)
|
||||
{
|
||||
s_the = this;
|
||||
}
|
||||
|
||||
NullDevice::~NullDevice()
|
||||
{
|
||||
}
|
||||
|
||||
bool NullDevice::can_read(Process&) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ssize_t NullDevice::read(Process&, byte*, ssize_t)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ssize_t NullDevice::write(Process&, const byte*, ssize_t buffer_size)
|
||||
{
|
||||
return min(GoodBufferSize, buffer_size);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue