1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 21:25:07 +00:00

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.
This commit is contained in:
Andreas Kling 2018-12-02 23:34:50 +01:00
parent 44036f32bc
commit 85b886c2e0
31 changed files with 88 additions and 94 deletions

View file

@ -34,18 +34,18 @@ bool RandomDevice::hasDataAvailableForRead() const
return true;
}
Unix::ssize_t RandomDevice::read(byte* buffer, Unix::size_t bufferSize)
ssize_t RandomDevice::read(byte* buffer, size_t bufferSize)
{
const int range = 'z' - 'a';
Unix::ssize_t nread = min(bufferSize, GoodBufferSize);
for (Unix::ssize_t i = 0; i < nread; ++i) {
ssize_t nread = min(bufferSize, GoodBufferSize);
for (ssize_t i = 0; i < nread; ++i) {
dword r = myrand() % range;
buffer[i] = 'a' + r;
}
return nread;
}
Unix::ssize_t RandomDevice::write(const byte*, Unix::size_t bufferSize)
ssize_t RandomDevice::write(const byte*, size_t bufferSize)
{
// FIXME: Use input for entropy? I guess that could be a neat feature?
return min(GoodBufferSize, bufferSize);