blob: 9a7685201f0183d43f0c1f48797f59c22c9d5c2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "ZeroDevice.h"
#include "Limits.h"
#include <AK/StdLib.h>
#include <cstring>
#include <cstdio>
ZeroDevice::ZeroDevice()
{
}
ZeroDevice::~ZeroDevice()
{
}
Unix::ssize_t ZeroDevice::read(byte* buffer, Unix::size_t bufferSize)
{
printf("read from zero device\n");
Unix::size_t count = min(GoodBufferSize, bufferSize);
memset(buffer, 0, count);
return count;
}
Unix::ssize_t ZeroDevice::write(const byte*, Unix::size_t bufferSize)
{
return min(GoodBufferSize, bufferSize);
}
|