1f08c3bdfSopenharmony_ci 2f08c3bdfSopenharmony_ci#ifndef __SWAP_ON_OFF_H_ 3f08c3bdfSopenharmony_ci#define __SWAP_ON_OFF_H_ 4f08c3bdfSopenharmony_ci 5f08c3bdfSopenharmony_ci/* 6f08c3bdfSopenharmony_ci * Read swapon(2) / swapoff(2) for a full history lesson behind the value of 7f08c3bdfSopenharmony_ci * MAX_SWAPFILES. 8f08c3bdfSopenharmony_ci */ 9f08c3bdfSopenharmony_ci#include <linux/version.h> 10f08c3bdfSopenharmony_ci#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) 11f08c3bdfSopenharmony_ci#define MAX_SWAPFILES 30 12f08c3bdfSopenharmony_ci#elif LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 10) 13f08c3bdfSopenharmony_ci#define MAX_SWAPFILES 32 14f08c3bdfSopenharmony_ci#else 15f08c3bdfSopenharmony_ci#define MAX_SWAPFILES 8 16f08c3bdfSopenharmony_ci#endif 17f08c3bdfSopenharmony_ci 18f08c3bdfSopenharmony_ci#endif 19