1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 18:55:07 +00:00
serenity/VirtualFileSystem/NullDevice.cpp
Andreas Kling 85b886c2e0 Make it possible to build the Kernel on a macOS host.
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.
2018-12-02 23:34:50 +01:00

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);
}