summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-15 11:28:07 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-15 13:56:47 +0100
commitfb4993f0677a003c80a1c82f5aad3eccdd9a9beb (patch)
treeb73c53feed61b4b1ddd68574641b5003557e4ded /Userland/Libraries
parent96f8fcdcbaf35461bb51b2fa1e190d8a7653b5eb (diff)
downloadserenity-fb4993f0677a003c80a1c82f5aad3eccdd9a9beb.zip
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. :^)
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibC/serenity.cpp6
-rw-r--r--Userland/Libraries/LibC/serenity.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/serenity.cpp b/Userland/Libraries/LibC/serenity.cpp
index 626a464ee8..3168a39d4c 100644
--- a/Userland/Libraries/LibC/serenity.cpp
+++ b/Userland/Libraries/LibC/serenity.cpp
@@ -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);
+}
}
diff --git a/Userland/Libraries/LibC/serenity.h b/Userland/Libraries/LibC/serenity.h
index 4654476469..16f370e27b 100644
--- a/Userland/Libraries/LibC/serenity.h
+++ b/Userland/Libraries/LibC/serenity.h
@@ -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)
{