[vala] posix: Add sys/mman.h memory management functions
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] posix: Add sys/mman.h memory management functions
- Date: Wed, 16 Sep 2009 15:04:02 +0000 (UTC)
commit d51f83634f988a55f36eee4037f021402c1493e8
Author: Julian Andres Klode <jak jak-linux org>
Date: Sun Aug 30 13:42:32 2009 +0200
posix: Add sys/mman.h memory management functions
Add support for the complete POSIX set of functions in mman.h like
mmap(), munmap() and mprotect() and also support the MLR and XSI
extension functions.
Signed-off-by: Julian Andres Klode <jak jak-linux org>
vapi/posix.vapi | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/vapi/posix.vapi b/vapi/posix.vapi
index d8c906c..9fcac11 100644
--- a/vapi/posix.vapi
+++ b/vapi/posix.vapi
@@ -1884,5 +1884,41 @@ namespace Posix {
public void FD_ZERO (fd_set @set);
[CCode (cheader_filename = "sys/select.h")]
public int pselect (int nfds, fd_set? readfds, fd_set? writefds, fd_set? exceptfds, timespec timeout, sigset_t sigmask);
+
+ // sys/mman.h - Posix mmap(), munmap(), mprotect()
+ [CCode (cheader_filename = "sys/mman.h")]
+ public void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
+ [CCode (cheader_filename = "sys/mman.h")]
+ public int munmap(void *addr, size_t length);
+ [CCode (cheader_filename = "sys/mman.h")]
+ public int mprotect(void *addr, size_t len, int prot);
+ [CCode (cheader_filename = "sys/mman.h")]
+ public const int PROT_READ;
+ [CCode (cheader_filename = "sys/mman.h")]
+ public const int PROT_WRITE;
+ [CCode (cheader_filename = "sys/mman.h")]
+ public const int PROT_EXEC;
+ [CCode (cheader_filename = "sys/mman.h")]
+ public const int MAP_SHARED;
+ [CCode (cheader_filename = "sys/mman.h")]
+ public const int MAP_PRIVATE;
+ [CCode (cheader_filename = "sys/mman.h")]
+ public const int MAP_FIXED;
+ [CCode (cheader_filename = "sys/mman.h")]
+ public void *MAP_FAILED;
+ // sys/mman.h - [MLR] Range Memory Locking
+ [CCode (cheader_filename = "sys/mman.h")]
+ public int mlock(void *addr, size_t len);
+ [CCode (cheader_filename = "sys/mman.h")]
+ public int munlock(void *addr, size_t len);
+ // sys/mman.h - [XSI] X/Open System Interfaces
+ [CCode (cheader_filename = "sys/mman.h")]
+ public int msync(void *addr, size_t len, int flags);
+ [CCode (cheader_filename = "sys/mman.h")]
+ public const int MS_ASYNC;
+ [CCode (cheader_filename = "sys/mman.h")]
+ public const int MS_INVALIDATE;
+ [CCode (cheader_filename = "sys/mman.h")]
+ public const int MS_SYNC;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]