dietlibc/dietlibc-0.28-madv.patch
ensc 4d9260872d - catch the case when syscall(2) is used on archs where it is not
implemented yet
- define MADV_* constants on HPPA and IA64 archs
- fix *truncate64() handling on 64bit archs
2005-04-24 19:49:59 +00:00

41 lines
1.7 KiB
Diff

2005-04-24 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
* include/sys/mman.h: define MADV_* constants for hppa and
ia64 archs
--- dietlibc-0.28/include/sys/mman.h.madv
+++ dietlibc-0.28/include/sys/mman.h
@@ -132,6 +132,22 @@
#define MCL_CURRENT 1 /* lock all current mappings */
#define MCL_FUTURE 2
+#define MADV_NORMAL 0 /* no further special treatment */
+#define MADV_RANDOM 1 /* expect random page references */
+#define MADV_SEQUENTIAL 2 /* expect sequential page references */
+#define MADV_WILLNEED 3 /* will need these pages */
+#define MADV_DONTNEED 4 /* don't need these pages */
+#define MADV_SPACEAVAIL 5 /* insure that resources are reserved */
+#define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */
+#define MADV_VPS_INHERIT 7 /* Inherit parents page size */
+#define MADV_4K_PAGES 12 /* Use 4K pages */
+#define MADV_16K_PAGES 14 /* Use 16K pages */
+#define MADV_64K_PAGES 16 /* Use 64K pages */
+#define MADV_256K_PAGES 18 /* Use 256K pages */
+#define MADV_1M_PAGES 20 /* Use 1 Megabyte pages */
+#define MADV_4M_PAGES 22 /* Use 4 Megabyte pages */
+#define MADV_16M_PAGES 24 /* Use 16 Megabyte pages */
+#define MADV_64M_PAGES 26 /* Use 64 Megabyte pages */
#elif defined(__ia64__)
#define MAP_TYPE 0x0f /* Mask for type of mapping */
@@ -151,6 +167,11 @@
#define MS_INVALIDATE 2 /* invalidate the caches */
#define MS_SYNC 4 /* synchronous memory sync */
+#define MADV_NORMAL 0x0 /* default page-in behavior */
+#define MADV_RANDOM 0x1 /* page-in minimum required */
+#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
+#define MADV_WILLNEED 0x3 /* pre-fault pages */
+#define MADV_DONTNEED 0x4 /* discard these pages */
#endif
/* compatibility flags */