From d95c079cbf05725f002a2c73243181d3c5410b24 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 --- libc-test/build.rs | 2 ++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index edfde387ce91..439bb88c4eee 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2268,6 +2268,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", @@ -2341,6 +2342,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/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 1e9ab1576625..5ec66c5e2aba 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -280,6 +280,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: crate::ipc_perm, __unused1: *mut c_void,