summaryrefslogtreecommitdiff
path: root/Libraries/LibC/mman.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-12 20:22:26 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-12 20:22:26 +0200
commitc19b56dc990eeb808c01b4cefd735322f0f0329f (patch)
treeb72b443f311d782b3bde3a243e1aa43a7020fce3 /Libraries/LibC/mman.h
parentdd00175ae2d6f23b08cb803eb86fc0108c393971 (diff)
downloadserenity-c19b56dc990eeb808c01b4cefd735322f0f0329f.zip
Kernel+LibC: Add minherit() and MAP_INHERIT_ZERO
This patch adds the minherit() syscall originally invented by OpenBSD. Only the MAP_INHERIT_ZERO mode is supported for now. If set on an mmap region, that region will be zeroed out on fork().
Diffstat (limited to 'Libraries/LibC/mman.h')
-rw-r--r--Libraries/LibC/mman.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibC/mman.h b/Libraries/LibC/mman.h
index 0f56dfb5fc..38c3069278 100644
--- a/Libraries/LibC/mman.h
+++ b/Libraries/LibC/mman.h
@@ -49,6 +49,8 @@
#define MADV_SET_NONVOLATILE 0x200
#define MADV_GET_VOLATILE 0x400
+#define MAP_INHERIT_ZERO 1
+
__BEGIN_DECLS
void* mmap(void* addr, size_t, int prot, int flags, int fd, off_t);
@@ -58,5 +60,6 @@ int munmap(void*, size_t);
int mprotect(void*, size_t, int prot);
int set_mmap_name(void*, size_t, const char*);
int madvise(void*, size_t, int advice);
+int minherit(void*, size_t, int inherit);
__END_DECLS