1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:37:44 +00:00

Base: Add man pages for create_shared_buffer() and share_buffer_with()

This commit is contained in:
Andreas Kling 2019-09-28 21:15:15 +02:00
parent d43c7d55f4
commit eb18825fce
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,23 @@
## Name
create\_shared\_buffer - create a shareable memory buffer
## Synopsis
```**c++
#include <SharedBuffer.h>
int create_shared_buffer(int size, void** buffer);
```
## Description
Creates a new memory region that can be shared with other processes. The region is only accessible to the creating process by default.
## Return value
If a region is successfully created, `create_shared_buffer()` 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.