mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +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:
parent
44036f32bc
commit
85b886c2e0
Notes:
sideshowbarker
2024-07-19 16:09:22 +09:00
Author: https://github.com/awesomekling
Commit: 85b886c2e0
31 changed files with 88 additions and 94 deletions
|
@ -170,7 +170,7 @@ bool SynthFS::writeInode(InodeIdentifier, const ByteBuffer&)
|
|||
return false;
|
||||
}
|
||||
|
||||
Unix::ssize_t SynthFS::read_inode_bytes(InodeIdentifier inode, Unix::off_t offset, Unix::size_t count, byte* buffer, FileDescriptor* handle) const
|
||||
ssize_t SynthFS::read_inode_bytes(InodeIdentifier inode, Unix::off_t offset, size_t count, byte* buffer, FileDescriptor* handle) const
|
||||
{
|
||||
ASSERT(inode.fsid() == id());
|
||||
#ifdef SYNTHFS_DEBUG
|
||||
|
@ -200,7 +200,7 @@ Unix::ssize_t SynthFS::read_inode_bytes(InodeIdentifier inode, Unix::off_t offse
|
|||
}
|
||||
|
||||
auto* data = generatedData ? &generatedData : &file.m_data;
|
||||
Unix::ssize_t nread = min(static_cast<Unix::off_t>(data->size() - offset), static_cast<Unix::off_t>(count));
|
||||
ssize_t nread = min(static_cast<Unix::off_t>(data->size() - offset), static_cast<Unix::off_t>(count));
|
||||
memcpy(buffer, data->pointer() + offset, nread);
|
||||
if (nread == 0 && handle && handle->generatorCache())
|
||||
handle->generatorCache().clear();
|
||||
|
@ -249,7 +249,7 @@ void SynthFSInode::populate_metadata() const
|
|||
// Already done when SynthFS created the file.
|
||||
}
|
||||
|
||||
Unix::ssize_t SynthFSInode::read_bytes(Unix::off_t offset, Unix::size_t count, byte* buffer, FileDescriptor* descriptor)
|
||||
ssize_t SynthFSInode::read_bytes(Unix::off_t offset, size_t count, byte* buffer, FileDescriptor* descriptor)
|
||||
{
|
||||
#ifdef SYNTHFS_DEBUG
|
||||
kprintf("SynthFS: read_bytes %u\n", index());
|
||||
|
@ -269,7 +269,7 @@ Unix::ssize_t SynthFSInode::read_bytes(Unix::off_t offset, Unix::size_t count, b
|
|||
}
|
||||
|
||||
auto* data = generatedData ? &generatedData : &m_data;
|
||||
Unix::ssize_t nread = min(static_cast<Unix::off_t>(data->size() - offset), static_cast<Unix::off_t>(count));
|
||||
ssize_t nread = min(static_cast<Unix::off_t>(data->size() - offset), static_cast<Unix::off_t>(count));
|
||||
memcpy(buffer, data->pointer() + offset, nread);
|
||||
if (nread == 0 && descriptor && descriptor->generatorCache())
|
||||
descriptor->generatorCache().clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue