1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

SharedBuffer: Split the creation and share steps

This allows us to seal a buffer *before* anyone else has access to it
(well, ok, the creating process still does, but you can't win them all).

It also means that a SharedBuffer can be shared with multiple clients:
all you need is to have access to it to share it on again.
This commit is contained in:
Robin Burchell 2019-07-18 09:52:22 +02:00 committed by Andreas Kling
parent f60d7e5d1f
commit b907608e46
12 changed files with 58 additions and 22 deletions

View file

@ -235,7 +235,9 @@ static u32 handle(RegisterDump& regs, u32 function, u32 arg1, u32 arg2, u32 arg3
case Syscall::SC_connect:
return current->process().sys$connect((int)arg1, (const sockaddr*)arg2, (socklen_t)arg3);
case Syscall::SC_create_shared_buffer:
return current->process().sys$create_shared_buffer((pid_t)arg1, (size_t)arg2, (void**)arg3);
return current->process().sys$create_shared_buffer((size_t)arg1, (void**)arg2);
case Syscall::SC_share_buffer_with:
return current->process().sys$share_buffer_with((int)arg1, (pid_t)arg2);
case Syscall::SC_get_shared_buffer:
return (u32)current->process().sys$get_shared_buffer((int)arg1);
case Syscall::SC_release_shared_buffer: