mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
Kernel: More work towards POSIX SHM, also add ftruncate().
This commit is contained in:
27
Kernel/SharedMemory.cpp
Normal file
27
Kernel/SharedMemory.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <Kernel/SharedMemory.h>
|
||||
#include <Kernel/VM/VMObject.h>
|
||||
|
||||
SharedMemory::SharedMemory()
|
||||
{
|
||||
}
|
||||
|
||||
SharedMemory::~SharedMemory()
|
||||
{
|
||||
}
|
||||
|
||||
KResult SharedMemory::truncate(int length)
|
||||
{
|
||||
if (!length) {
|
||||
m_vmo = nullptr;
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
if (!m_vmo) {
|
||||
m_vmo = VMObject::create_anonymous(length);
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
// FIXME: Support truncation.
|
||||
ASSERT_NOT_REACHED();
|
||||
return KResult(-ENOTIMPL);
|
||||
}
|
||||
Reference in New Issue
Block a user