diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index 6f44dffe83..8d5195163c 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -85,4 +85,11 @@ ErrorOr mmap(void* address, size_t size, int protection, int flags, int f #endif } +ErrorOr munmap(void* address, size_t size) +{ + if (::munmap(address, size) < 0) + return Error::from_syscall("munmap"sv, -errno); + return {}; +} + } diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h index 933c3bb71e..98517c73cc 100644 --- a/Userland/Libraries/LibCore/System.h +++ b/Userland/Libraries/LibCore/System.h @@ -21,5 +21,6 @@ ErrorOr sigaction(int signal, struct sigaction const* action, struct sigac ErrorOr fstat(int fd); ErrorOr fcntl(int fd, int command, ...); ErrorOr mmap(void* address, size_t, int protection, int flags, int fd, off_t, size_t alignment = 0, StringView name = {}); +ErrorOr munmap(void* address, size_t); }