mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
Kernel: More work towards POSIX SHM, also add ftruncate().
This commit is contained in:
parent
99f3cc26c3
commit
26a06f3fcd
10 changed files with 92 additions and 1 deletions
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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue