Skip to content

Commit

Permalink
Add structures for freebsd
Browse files Browse the repository at this point in the history
  • Loading branch information
Жунёва Мария Михайловна committed Jul 16, 2024
1 parent 7d7151c commit fbc340c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ task:
freebsd_instance:
image_family: freebsd-13-3
setup_script:
- pkg install -y libnghttp2 curl
- pkg install -y libnghttp2 curl evdev-proto
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
- . $HOME/.cargo/env
Expand All @@ -17,7 +17,7 @@ task:
freebsd_instance:
image: freebsd-14-1-release-amd64-ufs
setup_script:
- pkg install -y libnghttp2 curl
- pkg install -y libnghttp2 curl evdev-proto
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
- . $HOME/.cargo/env
Expand All @@ -31,7 +31,7 @@ task:
freebsd_instance:
image_family: freebsd-15-0-snap
setup_script:
- pkg install -y libnghttp2 curl
- pkg install -y libnghttp2 curl evdev-proto
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
- . $HOME/.cargo/env
Expand Down
5 changes: 5 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,9 @@ fn test_freebsd(target: &str) {
cfg.define("_WITH_GETLINE", None);
// Required for making freebsd11_stat available in the headers
cfg.define("_WANT_FREEBSD11_STAT", None);
cfg.define("LIBICONV_PLUG", None);

cfg.flag("-I/usr/local/include");

let freebsd13 = match freebsd_ver {
Some(n) if n >= 13 => true,
Expand Down Expand Up @@ -2091,6 +2094,7 @@ fn test_freebsd(target: &str) {
"sys/thr.h",
"sys/time.h",
[freebsd14 || freebsd15]:"sys/timerfd.h",
[freebsd13 || freebsd14 || freebsd15]:"linux/input.h",
"sys/times.h",
"sys/timex.h",
"sys/types.h",
Expand Down Expand Up @@ -2164,6 +2168,7 @@ fn test_freebsd(target: &str) {
"type_" if struct_ == "rtprio" => "type".to_string(),
"type_" if struct_ == "sockstat" => "type".to_string(),
"type_" if struct_ == "devstat_match_table" => "type".to_string(),
"type_" if struct_ == "input_event" => "type".to_string(),
s => s.to_string(),
}
});
Expand Down
16 changes: 16 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,22 @@ s! {
pub sem_flg: ::c_short,
}

pub struct input_event {
pub time: ::timeval,
pub type_: ::u_short,
pub code: ::u_short,
pub value: ::c_int,
}

pub struct input_absinfo {
pub value: ::c_int,
pub minimum: ::c_int,
pub maximum: ::c_int,
pub fuzz: ::c_int,
pub flat: ::c_int,
pub resolution: ::c_int,
}

pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
__unused1: *mut ::c_void,
Expand Down

0 comments on commit fbc340c

Please sign in to comment.