瀏覽代碼

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.
Idan Horowitz 3 年之前
父節點
當前提交
3080cc16ec
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 7 0
      Userland/Libraries/LibC/sys/mman.cpp
  2. 1 0
      Userland/Libraries/LibC/sys/mman.h

+ 7 - 0
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)
 {

+ 1 - 0
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