mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
Move VFS sources into Kernel/.
This commit is contained in:
parent
19104570cc
commit
754037874c
49 changed files with 35 additions and 37 deletions
34
Kernel/FullDevice.cpp
Normal file
34
Kernel/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, size_t bufferSize)
|
||||
{
|
||||
size_t count = min(GoodBufferSize, bufferSize);
|
||||
memset(buffer, 0, count);
|
||||
return count;
|
||||
}
|
||||
|
||||
ssize_t FullDevice::write(Process&, const byte*, size_t bufferSize)
|
||||
{
|
||||
if (bufferSize == 0)
|
||||
return 0;
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue