mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
Add a C++ helper class for working with shared buffers.
This is a bit more comfortable than passing the shared buffer ID manually everywhere and keeping track of size etc.
This commit is contained in:
parent
0b5d5fc3c9
commit
eda0866992
14 changed files with 186 additions and 46 deletions
|
@ -361,7 +361,7 @@ int read_tsc(unsigned* lsw, unsigned* msw)
|
|||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int create_shared_buffer(pid_t peer_pid, size_t size, void** buffer)
|
||||
int create_shared_buffer(pid_t peer_pid, int size, void** buffer)
|
||||
{
|
||||
int rc = syscall(SC_create_shared_buffer, peer_pid, size, buffer);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
|
@ -383,6 +383,18 @@ int release_shared_buffer(int shared_buffer_id)
|
|||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int get_shared_buffer_size(int shared_buffer_id)
|
||||
{
|
||||
int rc = syscall(SC_get_shared_buffer_size, shared_buffer_id);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int seal_shared_buffer(int shared_buffer_id)
|
||||
{
|
||||
int rc = syscall(SC_seal_shared_buffer, shared_buffer_id);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
char* getlogin()
|
||||
{
|
||||
assert(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue