2018-10-14 02:59:22 +02:00
|
|
|
#include "NullDevice.h"
|
|
|
|
#include "Limits.h"
|
|
|
|
#include <AK/StdLib.h>
|
2018-10-16 14:33:16 +02:00
|
|
|
#include <AK/kstdio.h>
|
2018-10-14 02:59:22 +02:00
|
|
|
|
|
|
|
NullDevice::NullDevice()
|
2018-10-30 13:59:29 +01:00
|
|
|
: CharacterDevice(1, 3)
|
2018-10-14 02:59:22 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NullDevice::~NullDevice()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-10-25 13:07:59 +02:00
|
|
|
bool NullDevice::hasDataAvailableForRead() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-10-14 22:57:41 +02:00
|
|
|
Unix::ssize_t NullDevice::read(byte*, Unix::size_t)
|
2018-10-14 02:59:22 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-10-14 22:57:41 +02:00
|
|
|
Unix::ssize_t NullDevice::write(const byte*, Unix::size_t bufferSize)
|
2018-10-14 02:59:22 +02:00
|
|
|
{
|
|
|
|
return min(GoodBufferSize, bufferSize);
|
|
|
|
}
|
|
|
|
|