فهرست منبع

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;
     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
 // https://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html
 int msync(void* address, size_t size, int flags)
 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);
 int madvise(void*, size_t, int advice);
 void* allocate_tls(const char* initial_data, size_t);
 void* allocate_tls(const char* initial_data, size_t);
 int mlock(const void*, size_t);
 int mlock(const void*, size_t);
+int munlock(const void*, size_t);
 int msync(void*, size_t, int flags);
 int msync(void*, size_t, int flags);
 
 
 __END_DECLS
 __END_DECLS