1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 18:15:07 +00:00

Kernel: Remove broken implementation of Unix SHM

This code never worked, as was never used for anything. We can build
a much better SHM implementation on top of TmpFS or similar when we
get to the point when we need one.
This commit is contained in:
Andreas Kling 2020-01-02 12:44:21 +01:00
parent 4fa7146da1
commit 7f04334664
11 changed files with 2 additions and 208 deletions

View file

@ -17,7 +17,6 @@
#include <Kernel/FileSystem/FileDescription.h>
#include <Kernel/FileSystem/InodeWatcher.h>
#include <Kernel/FileSystem/ProcFS.h>
#include <Kernel/FileSystem/SharedMemory.h>
#include <Kernel/FileSystem/TmpFS.h>
#include <Kernel/FileSystem/VirtualFileSystem.h>
#include <Kernel/Heap/kmalloc.h>
@ -3320,28 +3319,6 @@ int Process::sys$rename(const char* oldpath, const char* newpath)
return VFS::the().rename(StringView(oldpath), StringView(newpath), current_directory());
}
int Process::sys$shm_open(const char* name, int flags, mode_t mode)
{
if (!validate_read_str(name))
return -EFAULT;
int fd = alloc_fd();
if (fd < 0)
return fd;
auto shm_or_error = SharedMemory::open(String(name), flags, mode);
if (shm_or_error.is_error())
return shm_or_error.error();
auto description = FileDescription::create(shm_or_error.value());
m_fds[fd].set(move(description), FD_CLOEXEC);
return fd;
}
int Process::sys$shm_unlink(const char* name)
{
if (!validate_read_str(name))
return -EFAULT;
return SharedMemory::unlink(String(name));
}
int Process::sys$ftruncate(int fd, off_t length)
{
auto* description = file_description(fd);