• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef VTEST_SHM_H
2 #define VTEST_SHM_H
3 
4 #ifndef F_LINUX_SPECIFIC_BASE
5 #define F_LINUX_SPECIFIC_BASE 1024
6 #endif
7 
8 #ifndef F_ADD_SEALS
9 #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
10 #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
11 
12 #define F_SEAL_SEAL     0x0001  /* prevent further seals from being set */
13 #define F_SEAL_SHRINK   0x0002  /* prevent file from shrinking */
14 #define F_SEAL_GROW     0x0004  /* prevent file from growing */
15 #define F_SEAL_WRITE    0x0008  /* prevent writes */
16 #endif
17 
18 #ifndef MFD_CLOEXEC
19 #define MFD_CLOEXEC 0x0001U
20 #endif
21 
22 #ifndef MFD_ALLOW_SEALING
23 #define MFD_ALLOW_SEALING 0x0002U
24 #endif
25 
26 #ifndef MFD_HUGETLB
27 #define MFD_HUGETLB 0x0004U
28 #endif
29 
30 #ifndef MFD_HUGE_SHIFT
31 #define MFD_HUGE_SHIFT 26
32 #endif
33 
34 #include <stdint.h>
35 #include <string.h>
36 
37 int vtest_new_shm(uint32_t handle, size_t size);
38 int vtest_shm_check(void);
39 
40 #endif /* VTEST_MEMFD_H */
41