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

Kernel: Remove sys$shbuf_seal() and userland wrappers

There are no remaining users of this syscall so let it go. :^)
This commit is contained in:
Andreas Kling 2021-01-17 00:18:01 +01:00
parent 5522e8f59d
commit 05dbfe9ab6
13 changed files with 0 additions and 68 deletions

View file

@ -129,7 +129,6 @@ namespace Kernel {
S(chown) \
S(fchmod) \
S(symlink) \
S(shbuf_seal) \
S(sendmsg) \
S(recvmsg) \
S(getsockopt) \

View file

@ -338,7 +338,6 @@ public:
int sys$shbuf_allow_pid(int, pid_t peer_pid);
void* sys$shbuf_get(int shbuf_id, Userspace<size_t*> size);
int sys$shbuf_release(int shbuf_id);
int sys$shbuf_seal(int shbuf_id);
int sys$halt();
int sys$reboot();
int sys$realpath(Userspace<const Syscall::SC_realpath_params*>);

View file

@ -185,17 +185,4 @@ void SharedBuffer::destroy_if_unused()
}
}
void SharedBuffer::seal()
{
LOCKER(shared_buffers().lock());
m_writable = false;
for (auto& ref : m_refs) {
// TODO: Region needs to be RefCounted!
if (auto* region = ref.region.unsafe_ptr()) {
region->set_writable(false);
region->remap();
}
}
}
}

View file

@ -70,7 +70,6 @@ public:
static void share_all_shared_buffers(Process& from_process, Process& with_process);
size_t size() const { return m_vmobject->size(); }
void destroy_if_unused();
void seal();
AnonymousVMObject& vmobject() { return m_vmobject; }
const AnonymousVMObject& vmobject() const { return m_vmobject; }
int id() const { return m_shbuf_id; }

View file

@ -134,21 +134,4 @@ void* Process::sys$shbuf_get(int shbuf_id, Userspace<size_t*> user_size)
return shared_buffer.ref_for_process_and_get_address(*this);
}
int Process::sys$shbuf_seal(int shbuf_id)
{
REQUIRE_PROMISE(shared_buffer);
LOCKER(shared_buffers().lock());
auto it = shared_buffers().resource().find(shbuf_id);
if (it == shared_buffers().resource().end())
return -EINVAL;
auto& shared_buffer = *(*it).value;
if (!shared_buffer.is_shared_with(m_pid))
return -EPERM;
#ifdef SHARED_BUFFER_DEBUG
klog() << "Sealing shared buffer " << shbuf_id;
#endif
shared_buffer.seal();
return 0;
}
}