1 /* 2 * Copyright (C) 2017 Red Hat, Inc. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License as 6 * published by the Free Software Foundation; either version 2 of 7 * the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it would be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 */ 15 16 #ifndef LAPI_MEMFD_H 17 #define LAPI_MEMFD_H 18 19 /* flags for memfd_create(2) (unsigned int) */ 20 #ifndef MFD_CLOEXEC 21 # define MFD_CLOEXEC 0x0001U 22 #endif 23 #ifndef MFD_ALLOW_SEALING 24 # define MFD_ALLOW_SEALING 0x0002U 25 #endif 26 27 /* flags for memfd_create(3) and memfd_create(4) */ 28 #ifndef MFD_HUGETLB 29 #define MFD_HUGETLB 0x0004U 30 #endif 31 32 #ifndef MFD_HUGE_64KB 33 #define MFD_HUGE_64KB (16 << 26) 34 #endif 35 #ifndef MFD_HUGE_512KB 36 #define MFD_HUGE_512KB (19 << 26) 37 #endif 38 #ifndef MFD_HUGE_2MB 39 #define MFD_HUGE_2MB (21 << 26) 40 #endif 41 #ifndef MFD_HUGE_8MB 42 #define MFD_HUGE_8MB (23 << 26) 43 #endif 44 #ifndef MFD_HUGE_16MB 45 #define MFD_HUGE_16MB (24 << 26) 46 #endif 47 #ifndef MFD_HUGE_256MB 48 #define MFD_HUGE_256MB (28 << 26) 49 #endif 50 #ifndef MFD_HUGE_1GB 51 #define MFD_HUGE_1GB (30 << 26) 52 #endif 53 #ifndef MFD_HUGE_2GB 54 #define MFD_HUGE_2GB (31 << 26) 55 #endif 56 #ifndef MFD_HUGE_16GB 57 #define MFD_HUGE_16GB (34 << 26) 58 #endif 59 60 #endif 61