Skip to content

Commit

Permalink
freebsd add shm_largepage_conf data and its ioctl request.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Aug 29, 2022
1 parent a5553c2 commit 00e1367
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 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 @@ -2222,6 +2225,7 @@ fn test_freebsd(target: &str) {
"getlocalbase" if Some(13) > freebsd_ver => true,
"aio_readv" if Some(13) > freebsd_ver => true,
"aio_writev" if Some(13) > freebsd_ver => true,
"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

0 comments on commit 00e1367

Please sign in to comment.