mirror of
https://github.com/RGBCube/serenity
synced 2025-05-17 18:55:07 +00:00

It still requires an ELF compiler and linker, but at least it builds. I need to get rid of the "Unix" namespace. This does a lot of that.
29 lines
417 B
C++
29 lines
417 B
C++
#include "NullDevice.h"
|
|
#include "Limits.h"
|
|
#include <AK/StdLib.h>
|
|
#include <AK/kstdio.h>
|
|
|
|
NullDevice::NullDevice()
|
|
: CharacterDevice(1, 3)
|
|
{
|
|
}
|
|
|
|
NullDevice::~NullDevice()
|
|
{
|
|
}
|
|
|
|
bool NullDevice::hasDataAvailableForRead() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
ssize_t NullDevice::read(byte*, size_t)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
ssize_t NullDevice::write(const byte*, size_t bufferSize)
|
|
{
|
|
return min(GoodBufferSize, bufferSize);
|
|
}
|
|
|