mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
27f699ef0c
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
37 lines
552 B
C++
37 lines
552 B
C++
#include "NullDevice.h"
|
|
#include <AK/StdLibExtras.h>
|
|
#include <AK/kstdio.h>
|
|
|
|
static NullDevice* s_the;
|
|
|
|
NullDevice& NullDevice::the()
|
|
{
|
|
ASSERT(s_the);
|
|
return *s_the;
|
|
}
|
|
|
|
NullDevice::NullDevice()
|
|
: CharacterDevice(1, 3)
|
|
{
|
|
s_the = this;
|
|
}
|
|
|
|
NullDevice::~NullDevice()
|
|
{
|
|
}
|
|
|
|
bool NullDevice::can_read(FileDescription&) const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
ssize_t NullDevice::read(FileDescription&, u8*, ssize_t)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
ssize_t NullDevice::write(FileDescription&, const u8*, ssize_t buffer_size)
|
|
{
|
|
return min(PAGE_SIZE, buffer_size);
|
|
}
|