mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17: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
34
Kernel/Devices/FullDevice.cpp
Normal file
34
Kernel/Devices/FullDevice.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include "FullDevice.h"
|
||||
#include "Limits.h"
|
||||
#include <LibC/errno_numbers.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/kstdio.h>
|
||||
|
||||
FullDevice::FullDevice()
|
||||
: CharacterDevice(1, 7)
|
||||
{
|
||||
}
|
||||
|
||||
FullDevice::~FullDevice()
|
||||
{
|
||||
}
|
||||
|
||||
bool FullDevice::can_read(Process&) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ssize_t FullDevice::read(Process&, byte* buffer, ssize_t size)
|
||||
{
|
||||
ssize_t count = min(GoodBufferSize, size);
|
||||
memset(buffer, 0, (size_t)count);
|
||||
return count;
|
||||
}
|
||||
|
||||
ssize_t FullDevice::write(Process&, const byte*, ssize_t size)
|
||||
{
|
||||
if (size == 0)
|
||||
return 0;
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue