1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:57:45 +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

@ -45,7 +45,6 @@ If the process later attempts to use any system functionality it has previously
* `dpath`: Creating new device files
* `chown`: Changing file owner/group
* `fattr`: Changing file attributes/permissions
* `shared_buffer`: Shared memory buffers (\*)
* `chroot`: The [`chroot(2)`](chroot.md) syscall (\*)
* `video`: May use [`ioctl(2)`](ioctl.md) and [`mmap(2)`](mmap.md) on framebuffer video devices
* `settime`: Changing the system time and date

View file

@ -1,28 +0,0 @@
## Name
shbuf\_allow\_pid - allow another process to map a shareable buffer
## Synopsis
```**c++
#include <SharedBuffer.h>
int shbuf_allow_pid(int shbuf_id, pid_t peer_pid);
```
## Description
Gives the process with PID `peer_pid` permission to map the shareable buffer with ID `shbuf_id`.
## Return value
On success, returns 0. Otherwise, returns -1 and `errno` is set.
## Errors
* `EINVAL`: `peer_pid` is invalid, or `shbuf_id` is not a valid ID.
* `EPERM`: The calling process does not have access to the buffer with `shbuf_id`.
* `ESRCH`: No process with PID `peer_pid` is found.
## See also
* [`shbuf_create`(2)](shbuf_create.md)

View file

@ -1,27 +0,0 @@
## Name
shbuf\_create - create a shareable memory buffer
## Synopsis
```**c++
#include <SharedBuffer.h>
int shbuf_create(int size, void** buffer);
```
## Description
Creates a new memory region that can be shared with other processes. The region is only accessible to the calling process by default.
## Return value
If a region is successfully created, `shbuf_create()` stores a pointer to the memory in `buffer` and returns a buffer ID. Otherwise, it returns -1 and sets `errno` to describe the error.
## Errors
* `EINVAL`: `size` is zero or negative.
* `EFAULT`: `buffer` is not a valid address.
## See also
* [`shbuf_allow_pid`(2)](shbuf_allow_pid.md)