forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kernel+LibC: Rename shared buffer syscalls to use a prefix
This feels a lot more consistent and Unixy: create_shared_buffer() => shbuf_create() share_buffer_with() => shbuf_allow_pid() share_buffer_globally() => shbuf_allow_all() get_shared_buffer() => shbuf_get() release_shared_buffer() => shbuf_release() seal_shared_buffer() => shbuf_seal() get_shared_buffer_size() => shbuf_get_size() Also, "shared_buffer_id" is shortened to "shbuf_id" all around.
- Loading branch information
1 parent
8460d02
commit f72e5bb
Showing
36 changed files
with
581 additions
and
581 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
12 changes: 6 additions & 6 deletions
12
Base/usr/share/man/man2/share_buffer_with.md → Base/usr/share/man/man2/shbuf_allow_pid.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
## Name | ||
|
||
share\_buffer\_with - allow another process to map a shareable buffer | ||
shbuf\_allow\_pid - allow another process to map a shareable buffer | ||
|
||
## Synopsis | ||
```**c++ | ||
#include <SharedBuffer.h> | ||
int share_buffer_with(int shared_buffer_id, pid_t peer_pid); | ||
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 `shared_buffer_id`. | ||
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 `shared_buffer_id` is not a valid ID. | ||
* `EPERM`: The calling process does not have access to the buffer with `shared_buffer_id`. | ||
* `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 | ||
|
||
* [`create_shared_buffer`(2)](create_shared_buffer.md) | ||
* [`shbuf_create`(2)](shbuf_create.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## 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) |
Oops, something went wrong.