File tree 2 files changed +44
-0
lines changed
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ Added new ` MemFdCreateFlag ` constants to ` sys::memfd ` on Linux and Android related to hugetlbfs support.
Original file line number Diff line number Diff line change @@ -29,6 +29,49 @@ libc_bitflags!(
29
29
///
30
30
/// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html
31
31
MFD_ALLOW_SEALING ;
32
+ /// Anonymous file will be created using huge pages. It should be safe now to
33
+ /// combine with [`MFD_ALLOW_SEALING`] too.
34
+ /// However, despite its presence, on FreeBSD it is unimplemented for now (ENOSYS).
35
+ ///
36
+ /// See also the hugetlb filesystem in [`memfd_create(2)`].
37
+ ///
38
+ /// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html
39
+ #[ cfg( linux_android) ]
40
+ MFD_HUGETLB ;
41
+ /// Following are to be used with [`MFD_HUGETLB`], indicating the desired hugetlb size.
42
+ ///
43
+ /// See also the hugetlb filesystem in [`memfd_create(2)`].
44
+ ///
45
+ /// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html
46
+ #[ cfg( linux_android) ]
47
+ MFD_HUGE_1MB ;
48
+ /// hugetlb size of 2MB.
49
+ #[ cfg( linux_android) ]
50
+ MFD_HUGE_2MB ;
51
+ /// hugetlb size of 8MB.
52
+ #[ cfg( linux_android) ]
53
+ MFD_HUGE_8MB ;
54
+ /// hugetlb size of 16MB.
55
+ #[ cfg( linux_android) ]
56
+ MFD_HUGE_16MB ;
57
+ /// hugetlb size of 32MB.
58
+ #[ cfg( linux_android) ]
59
+ MFD_HUGE_32MB ;
60
+ /// hugetlb size of 256MB.
61
+ #[ cfg( linux_android) ]
62
+ MFD_HUGE_256MB ;
63
+ /// hugetlb size of 512MB.
64
+ #[ cfg( linux_android) ]
65
+ MFD_HUGE_512MB ;
66
+ /// hugetlb size of 1GB.
67
+ #[ cfg( linux_android) ]
68
+ MFD_HUGE_1GB ;
69
+ /// hugetlb size of 2GB.
70
+ #[ cfg( linux_android) ]
71
+ MFD_HUGE_2GB ;
72
+ /// hugetlb size of 16GB.
73
+ #[ cfg( linux_android) ]
74
+ MFD_HUGE_16GB ;
32
75
}
33
76
) ;
34
77
You can’t perform that action at this time.
0 commit comments