summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/serenity.cpp
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/LibC/serenity.cpp
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/LibC/serenity.cpp')
-rw-r--r--Userland/Libraries/LibC/serenity.cpp6
1 files changed, 6 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);
+}
}