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

Kernel: Add anonymous files, created with sys$anon_create()

This patch adds a new AnonymousFile class which is a File backed by
an AnonymousVMObject that can only be mmap'ed and nothing else, really.

I'm hoping that this can become a replacement for shbufs. :^)
This commit is contained in:
Andreas Kling 2021-01-15 11:28:07 +01:00
parent 96f8fcdcba
commit fb4993f067
8 changed files with 191 additions and 1 deletions

View file

@ -136,4 +136,10 @@ 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);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int anon_create(size_t size, int options)
{
int rc = syscall(SC_anon_create, size, options);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}

View file

@ -73,6 +73,8 @@ int perf_event(int type, uintptr_t arg1, uintptr_t arg2);
int get_stack_bounds(uintptr_t* user_stack_base, size_t* user_stack_size);
int anon_create(size_t size, int options);
#ifdef __i386__
ALWAYS_INLINE void send_secret_data_to_userspace_emulator(uintptr_t data1, uintptr_t data2, uintptr_t data3)
{