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

Kernel+Userland: Remove shared buffers (shbufs)

All users of this mechanism have been switched to anonymous files and
passing file descriptors with sendfd()/recvfd().

Shbufs got us where we are today, but it's time we say good-bye to them
and welcome a much more idiomatic replacement. :^)
This commit is contained in:
Andreas Kling 2021-01-17 08:51:41 +01:00
parent 2cd16778b5
commit bf0719092f
28 changed files with 2 additions and 1022 deletions

View file

@ -79,34 +79,6 @@ int perf_event(int type, uintptr_t arg1, FlatPtr arg2)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
void* shbuf_get(int shbuf_id, size_t* size)
{
ssize_t rc = syscall(SC_shbuf_get, shbuf_id, size);
if (rc < 0 && -rc < EMAXERRNO) {
errno = -rc;
return (void*)-1;
}
return (void*)rc;
}
int shbuf_release(int shbuf_id)
{
int rc = syscall(SC_shbuf_release, shbuf_id);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int shbuf_create(int size, void** buffer)
{
int rc = syscall(SC_shbuf_create, size, buffer);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int shbuf_allow_pid(int shbuf_id, pid_t peer_pid)
{
int rc = syscall(SC_shbuf_allow_pid, shbuf_id, peer_pid);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int get_stack_bounds(uintptr_t* user_stack_base, size_t* user_stack_size)
{
int rc = syscall(SC_get_stack_bounds, user_stack_base, user_stack_size);