From 3080cc16ec954040e98b5c7a3f78cee50b9e5385 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 4 Dec 2021 23:00:49 +0200 Subject: [PATCH] LibC: Stub out munlock() This function is supposed to unlock memory ranges that were locked by mlock, but since mlock is stubbed out right now, this is a no-op. --- Userland/Libraries/LibC/sys/mman.cpp | 7 +++++++ Userland/Libraries/LibC/sys/mman.h | 1 + 2 files changed, 8 insertions(+) diff --git a/Userland/Libraries/LibC/sys/mman.cpp b/Userland/Libraries/LibC/sys/mman.cpp index faee202e00..df796f3e86 100644 --- a/Userland/Libraries/LibC/sys/mman.cpp +++ b/Userland/Libraries/LibC/sys/mman.cpp @@ -94,6 +94,13 @@ int mlock(const void*, size_t) return 0; } +// https://pubs.opengroup.org/onlinepubs/9699919799/functions/munlock.html +int munlock(const void*, size_t) +{ + dbgln("FIXME: Implement munlock()"); + return 0; +} + // https://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html int msync(void* address, size_t size, int flags) { diff --git a/Userland/Libraries/LibC/sys/mman.h b/Userland/Libraries/LibC/sys/mman.h index c1eacbe127..1a304478fd 100644 --- a/Userland/Libraries/LibC/sys/mman.h +++ b/Userland/Libraries/LibC/sys/mman.h @@ -20,6 +20,7 @@ int set_mmap_name(void*, size_t, const char*); int madvise(void*, size_t, int advice); void* allocate_tls(const char* initial_data, size_t); int mlock(const void*, size_t); +int munlock(const void*, size_t); int msync(void*, size_t, int flags); __END_DECLS