Skip to content

Commit

Permalink
Auto merge of #2829 - devnexen:fbsd_mfd_upd, r=Amanieu
Browse files Browse the repository at this point in the history
memfd_create additional flags for FreeBSD.
  • Loading branch information
bors committed Jun 20, 2022
2 parents 956ea0e + 25f2151 commit f292633
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2105,6 +2105,19 @@ fn test_freebsd(target: &str) {
| "MFD_CLOEXEC"
| "MFD_ALLOW_SEALING"
| "MFD_HUGETLB"
| "MFD_HUGE_MASK"
| "MFD_HUGE_64KB"
| "MFD_HUGE_512KB"
| "MFD_HUGE_1MB"
| "MFD_HUGE_2MB"
| "MFD_HUGE_8MB"
| "MFD_HUGE_16MB"
| "MFD_HUGE_32MB"
| "MFD_HUGE_256MB"
| "MFD_HUGE_512MB"
| "MFD_HUGE_1GB"
| "MFD_HUGE_2GB"
| "MFD_HUGE_16GB"
if Some(13) > freebsd_ver =>
{
true
Expand Down
16 changes: 16 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,22 @@ MAXTC
MCL_CURRENT
MCL_FUTURE
MDMBUF
MFD_ALLOW_SEALING
MFD_CLOEXEC
MFD_HUGE_16GB
MFD_HUGE_16MB
MFD_HUGE_1GB
MFD_HUGE_1MB
MFD_HUGE_256MB
MFD_HUGE_2GB
MFD_HUGE_2MB
MFD_HUGE_32MB
MFD_HUGE_512KB
MFD_HUGE_512MB
MFD_HUGE_64KB
MFD_HUGE_8MB
MFD_HUGE_MASK
MFD_HUGETLB
MINCORE_INCORE
MINCORE_MODIFIED
MINCORE_MODIFIED_OTHER
Expand Down
13 changes: 13 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3657,6 +3657,19 @@ pub const CPUCLOCK_WHICH_TID: ::c_int = 1;
pub const MFD_CLOEXEC: ::c_uint = 0x00000001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x00000002;
pub const MFD_HUGETLB: ::c_uint = 0x00000004;
pub const MFD_HUGE_MASK: ::c_uint = 0xFC000000;
pub const MFD_HUGE_64KB: ::c_uint = 16 << 26;
pub const MFD_HUGE_512KB: ::c_uint = 19 << 26;
pub const MFD_HUGE_1MB: ::c_uint = 20 << 26;
pub const MFD_HUGE_2MB: ::c_uint = 21 << 26;
pub const MFD_HUGE_8MB: ::c_uint = 23 << 26;
pub const MFD_HUGE_16MB: ::c_uint = 24 << 26;
pub const MFD_HUGE_32MB: ::c_uint = 25 << 26;
pub const MFD_HUGE_256MB: ::c_uint = 28 << 26;
pub const MFD_HUGE_512MB: ::c_uint = 29 << 26;
pub const MFD_HUGE_1GB: ::c_uint = 30 << 26;
pub const MFD_HUGE_2GB: ::c_uint = 31 << 26;
pub const MFD_HUGE_16GB: ::c_uint = 34 << 26;

pub const SHM_LARGEPAGE_ALLOC_DEFAULT: ::c_int = 0;
pub const SHM_LARGEPAGE_ALLOC_NOWAIT: ::c_int = 1;
Expand Down

0 comments on commit f292633

Please sign in to comment.