Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freebsd add shm_largepage_conf data and its ioctl request. #2892

Merged
merged 1 commit into from Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions libc-test/build.rs
Expand Up @@ -2148,6 +2148,9 @@ fn test_freebsd(target: &str) {
// Added in FreeBSD 14
"LIO_READV" | "LIO_WRITEV" | "LIO_VECTORED" if Some(14) > freebsd_ver => true,

// Added in FreeBSD 13
"FIOSSHMLPGCNF" if Some(13) > freebsd_ver => true,

_ => false,
}
});
Expand Down Expand Up @@ -2178,6 +2181,8 @@ fn test_freebsd(target: &str) {

// `sockcred2` is not available in FreeBSD 12.
"sockcred2" if Some(13) > freebsd_ver => true,
// `shm_largepage_conf` was introduced in FreeBSD 13.
"shm_largepage_conf" if Some(13) > freebsd_ver => true,

_ => false,
}
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/freebsd.txt
Expand Up @@ -341,6 +341,7 @@ FIONWRITE
FIOSEEKDATA
FIOSEEKHOLE
FIOSETOWN
FIOSSHMLPGCNF
FLUSHO
FOPEN_MAX
F_DUP2FD
Expand Down
7 changes: 7 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -992,6 +992,12 @@ s! {
pub _flags: u32,
pub _clockid: u32,
}

pub struct shm_largepage_conf {
pub psind: ::c_int,
pub alloc_policy: ::c_int,
__pad: [::c_int; 10],
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -2254,6 +2260,7 @@ pub const FIONWRITE: ::c_ulong = 0x40046677;
pub const FIONSPACE: ::c_ulong = 0x40046676;
pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
pub const FIOSSHMLPGCNF: ::c_ulong = 0x80306664;

pub const JAIL_API_VERSION: u32 = 2;
pub const JAIL_CREATE: ::c_int = 0x01;
Expand Down