From 9fa9bd0411163c324f4da6d244a09d2f6fad438d Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Mon, 5 Feb 2024 23:46:57 +0100 Subject: [PATCH] userspace: add PROT flag for mmap --- userspace/libc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/userspace/libc.h b/userspace/libc.h index 166e51c..9ef9596 100644 --- a/userspace/libc.h +++ b/userspace/libc.h @@ -36,6 +36,10 @@ int putc(const int c); int vsnprintf(char *str, size_t size, const char *format, va_list ap) __attribute__ ((__format__ (printf, 3, 0))); int vprintf(const char *format, va_list ap) __attribute__ ((__format__ (printf, 1, 0))); int printf(const char *format, ...) __attribute__ ((__format__ (printf, 1, 2))); +/* To keep in sync with PAGING_MEM_* */ +#define PROT_EXEC (1<<3) +#define PROT_READ (1<<1) +#define PROT_WRITE (1<<2) void *mmap(void *addr, size_t len, int prot, int flags, char *path); int asprintf(char **strp, const char *fmt, ...) __attribute__ ((__format__ (printf, 2, 3)));