summaryrefslogtreecommitdiff
path: root/ltp_framework/include/swaponoff.h
diff options
context:
space:
mode:
authorLe Chi Thu <thu2004@yahoo.se>2012-04-03 01:23:00 +0200
committerLe Chi Thu <thu2004@yahoo.se>2012-04-03 01:23:00 +0200
commit01c165cd1b2ac601d5ae73d3cb5e82ccdd94ac94 (patch)
tree777ab4b2289c860cab0b438f08e4f30bd52d9af5 /ltp_framework/include/swaponoff.h
Initial commit
Diffstat (limited to 'ltp_framework/include/swaponoff.h')
-rw-r--r--ltp_framework/include/swaponoff.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/ltp_framework/include/swaponoff.h b/ltp_framework/include/swaponoff.h
new file mode 100644
index 0000000..e3eae3f
--- /dev/null
+++ b/ltp_framework/include/swaponoff.h
@@ -0,0 +1,18 @@
+
+#ifndef __SWAP_ON_OFF_H_
+#define __SWAP_ON_OFF_H_
+
+/*
+ * Read swapon(2) / swapoff(2) for a full history lesson behind the value of
+ * MAX_SWAPFILES.
+ */
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
+#define MAX_SWAPFILES 30
+#elif LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 10)
+#define MAX_SWAPFILES 32
+#else
+#define MAX_SWAPFILES 8
+#endif
+
+#endif