Skip to content

Commit e077dbf

Browse files
committed
Auto merge of #3508 - devnexen:freebsd_15_support, r=JohnTitor
freebsd 15 support proposal.
2 parents d3238e0 + 2dc04b8 commit e077dbf

File tree

7 files changed

+650
-27
lines changed

7 files changed

+650
-27
lines changed

.cirrus.yml

+14
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,17 @@ task:
2525
- . $HOME/.cargo/env
2626
- LIBC_CI=1 sh ci/run.sh x86_64-unknown-freebsd
2727
- sh ci/run.sh x86_64-unknown-freebsd
28+
29+
task:
30+
name: nightly x86_64-unknown-freebsd-15
31+
freebsd_instance:
32+
image_family: freebsd-15-0-snap
33+
setup_script:
34+
- pkg install -y libnghttp2 curl
35+
- curl https://sh.rustup.rs -sSf --output rustup.sh
36+
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
37+
- . $HOME/.cargo/env
38+
test_script:
39+
- . $HOME/.cargo/env
40+
- LIBC_CI=1 sh ci/run.sh x86_64-unknown-freebsd
41+
- sh ci/run.sh x86_64-unknown-freebsd

build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
1313
"freebsd12",
1414
"freebsd13",
1515
"freebsd14",
16+
"freebsd15",
1617
"libc_align",
1718
"libc_cfg_target_vendor",
1819
"libc_const_extern_fn",
@@ -70,6 +71,7 @@ fn main() {
7071
Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
7172
Some(13) if libc_ci => set_cfg("freebsd13"),
7273
Some(14) if libc_ci => set_cfg("freebsd14"),
74+
Some(15) if libc_ci => set_cfg("freebsd15"),
7375
Some(_) | None => set_cfg("freebsd11"),
7476
}
7577

@@ -252,6 +254,7 @@ fn which_freebsd() -> Option<i32> {
252254
s if s.starts_with("12") => Some(12),
253255
s if s.starts_with("13") => Some(13),
254256
s if s.starts_with("14") => Some(14),
257+
s if s.starts_with("15") => Some(15),
255258
_ => None,
256259
}
257260
}

libc-test/build.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,7 @@ fn test_freebsd(target: &str) {
20142014
Some(12) => cfg.cfg("freebsd12", None),
20152015
Some(13) => cfg.cfg("freebsd13", None),
20162016
Some(14) => cfg.cfg("freebsd14", None),
2017+
Some(15) => cfg.cfg("freebsd15", None),
20172018
_ => &mut cfg,
20182019
};
20192020

@@ -2032,6 +2033,10 @@ fn test_freebsd(target: &str) {
20322033
Some(n) if n >= 14 => true,
20332034
_ => false,
20342035
};
2036+
let freebsd15 = match freebsd_ver {
2037+
Some(n) if n >= 15 => true,
2038+
_ => false,
2039+
};
20352040

20362041
headers! { cfg:
20372042
"aio.h",
@@ -2119,7 +2124,7 @@ fn test_freebsd(target: &str) {
21192124
"sys/sysctl.h",
21202125
"sys/thr.h",
21212126
"sys/time.h",
2122-
[freebsd14]:"sys/timerfd.h",
2127+
[freebsd14 || freebsd15]:"sys/timerfd.h",
21232128
"sys/times.h",
21242129
"sys/timex.h",
21252130
"sys/types.h",
@@ -2403,6 +2408,9 @@ fn test_freebsd(target: &str) {
24032408
true
24042409
}
24052410

2411+
// Introduced in FreeBSD 14 then removed ?
2412+
"TCP_LRD" if freebsd_ver >= Some(15) => true,
2413+
24062414
// Added in FreeBSD 14
24072415
"LIO_READV" | "LIO_WRITEV" | "LIO_VECTORED" if Some(14) > freebsd_ver => true,
24082416

@@ -4512,6 +4520,7 @@ fn which_freebsd() -> Option<i32> {
45124520
s if s.starts_with("12") => Some(12),
45134521
s if s.starts_with("13") => Some(13),
45144522
s if s.starts_with("14") => Some(14),
4523+
s if s.starts_with("15") => Some(15),
45154524
_ => None,
45164525
}
45174526
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#[repr(C)]
2+
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
3+
pub struct stat {
4+
pub st_dev: ::dev_t,
5+
pub st_ino: ::ino_t,
6+
pub st_nlink: ::nlink_t,
7+
pub st_mode: ::mode_t,
8+
st_padding0: i16,
9+
pub st_uid: ::uid_t,
10+
pub st_gid: ::gid_t,
11+
st_padding1: i32,
12+
pub st_rdev: ::dev_t,
13+
pub st_atime: ::time_t,
14+
pub st_atime_nsec: ::c_long,
15+
pub st_mtime: ::time_t,
16+
pub st_mtime_nsec: ::c_long,
17+
pub st_ctime: ::time_t,
18+
pub st_ctime_nsec: ::c_long,
19+
pub st_birthtime: ::time_t,
20+
pub st_birthtime_nsec: ::c_long,
21+
pub st_size: ::off_t,
22+
pub st_blocks: ::blkcnt_t,
23+
pub st_blksize: ::blksize_t,
24+
pub st_flags: ::fflags_t,
25+
pub st_gen: u64,
26+
pub st_spare: [u64; 10],
27+
}
28+
29+
impl ::Copy for ::stat {}
30+
impl ::Clone for ::stat {
31+
fn clone(&self) -> ::stat {
32+
*self
33+
}
34+
}

0 commit comments

Comments
 (0)