From b668252303c6a79c465aabc9a002bc0b4a79df6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=96=D1=83=D0=BD=D1=91=D0=B2=D0=B0=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=9C=D0=B8=D1=85=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D0=BD=D0=B0?= Date: Fri, 21 Jun 2024 18:21:30 +0300 Subject: [PATCH] Add structures for freebsd (backport ) (cherry picked from commit 187468d37a3e9d785d915bfe7b82f81c3c6dc3f1) --- libc-test/build.rs | 2 ++ libc-test/semver/freebsd.txt | 2 ++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index eb41e2eaa7ac8..4aa1fa8bd8338 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2312,6 +2312,7 @@ fn test_freebsd(target: &str) { "sys/thr.h", "sys/time.h", [freebsd14 || freebsd15]:"sys/timerfd.h", + [freebsd13 || freebsd14 || freebsd15]:"dev/evdev/input.h", "sys/times.h", "sys/timex.h", "sys/types.h", @@ -2385,6 +2386,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(), } }); diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 486d11e64a60a..a5a9f9befb9d9 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -2026,6 +2026,8 @@ ifconf ifreq in6_pktinfo initgroups +input_absinfo +input_event ip_mreqn ipc_perm jail diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index ae4e366afdd48..23bbb1e1c47fe 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -290,6 +290,22 @@ s! { pub sem_flg: c_short, } + pub struct input_event { + pub time: crate::timeval, + pub type_: crate::u_short, + pub code: crate::u_short, + pub value: i32, + } + + pub struct input_absinfo { + pub value: i32, + pub minimum: i32, + pub maximum: i32, + pub fuzz: i32, + pub flat: i32, + pub resolution: i32, + } + pub struct msqid_ds { pub msg_perm: crate::ipc_perm, __unused1: *mut c_void,