summaryrefslogtreecommitdiff
path: root/include/sys/mman.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-09-08 23:07:54 +0000
committerMike Frysinger <vapier@gentoo.org>2006-09-08 23:07:54 +0000
commit70d14139d8d160700d5a1d7add6e9202308091a9 (patch)
tree37fa80f81f4123174d055dbbbfb793dcf2c469ee /include/sys/mman.h
parent84211be0889a59d7188645aefb5325ddfd642627 (diff)
add some inline funcs for the mlock funcs on no-mmu
Diffstat (limited to 'include/sys/mman.h')
-rw-r--r--include/sys/mman.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sys/mman.h b/include/sys/mman.h
index aeeea7d0e..10f4afe24 100644
--- a/include/sys/mman.h
+++ b/include/sys/mman.h
@@ -100,6 +100,7 @@ extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
#endif
#ifdef __ARCH_USE_MMU__
+
/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
be memory resident. */
extern int mlock (__const void *__addr, size_t __len) __THROW;
@@ -115,6 +116,17 @@ extern int mlockall (int __flags) __THROW;
/* All currently mapped pages of the process' address space become
unlocked. */
extern int munlockall (void) __THROW;
+
+#else
+
+/* On no-mmu systems, memory cannot be swapped out, so
+ * these functions will always succeed.
+ */
+static inline int mlock (__const void *__addr, size_t __len) { return 0; }
+static inline int munlock (__const void *__addr, size_t __len) { return 0; }
+static inline int mlockall (int __flags) { return 0; }
+static inline int munlockall (void) { return 0; }
+
#endif
#ifdef __USE_MISC