diff --git a/libc-test/build.rs b/libc-test/build.rs index 754d49cc81554..fb779daecc123 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3746,6 +3746,9 @@ fn test_linux(target: &str) { if musl && ty == "fanout_args" { return true; } + if sparc64 && ty == "fanotify_event_info_error" { + return true; + } match ty { // These cannot be tested when "resolv.h" is included and are tested @@ -4490,7 +4493,11 @@ fn test_linux(target: &str) { // the `tcpi_delivery_rate_app_limited` field is a bitfield on musl (musl && struct_ == "tcp_info" && field == "tcpi_delivery_rate_app_limited") || // the `tcpi_fast_open_client_fail` field is a bitfield on musl - (musl && struct_ == "tcp_info" && field == "tcpi_fast_open_client_fail") + (musl && struct_ == "tcp_info" && field == "tcpi_fast_open_client_fail") || + // either fsid_t or int[2] type + (struct_ == "fanotify_event_info_fid" && field == "fsid") || + // `handle` is a VLA + (struct_ == "fanotify_event_info_fid" && field == "handle") }); cfg.skip_roundtrip(move |s| match s { diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt index 72e993611ce04..bca6e4fd18ed7 100644 --- a/libc-test/semver/linux-gnu.txt +++ b/libc-test/semver/linux-gnu.txt @@ -628,12 +628,15 @@ dlinfo dlmopen endutxent explicit_bzero +fanotify_event_info_error +fanotify_event_info_header +fanotify_event_info_pidfd +fgetgrent_r fgetspent_r futimes getauxval getentropy getgrent_r -fgetgrent_r getloadavg getpt getpwent_r diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index ebbe04d1b7262..d0b966f4f1085 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -3497,6 +3497,7 @@ execvpe faccessat fallocate fallocate64 +fanotify_event_info_fid fanotify_event_metadata fanotify_init fanotify_mark diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index c77500cbbfbb1..7fd7fb190ca9d 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -492,6 +492,17 @@ s! { pub tcpi_rcv_space: u32, pub tcpi_total_retrans: u32, } + + pub struct fanotify_event_info_pidfd { + pub hdr: ::fanotify_event_info_header, + pub pidfd: ::__s32, + } + + pub struct fanotify_event_info_error { + pub hdr: ::fanotify_event_info_header, + pub error: ::__s32, + pub error_count: ::__u32, + } } impl siginfo_t { diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index a7815ddfc3c14..3ca4446e66ef1 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -16,6 +16,7 @@ pub type loff_t = ::c_longlong; pub type pthread_key_t = ::c_uint; pub type pthread_once_t = ::c_int; pub type pthread_spinlock_t = ::c_int; +pub type __kernel_fsid_t = __c_anonymous__kernel_fsid_t; pub type __u8 = ::c_uchar; pub type __u16 = ::c_ushort; @@ -548,6 +549,20 @@ s! { pub sh_entsize: Elf64_Xword, } + pub struct __c_anonymous_elf32_rel { + pub r_offset: Elf32_Addr, + pub r_info: Elf32_Word, + } + + pub struct __c_anonymous_elf64_rel { + pub r_offset: Elf64_Addr, + pub r_info: Elf64_Xword, + } + + pub struct __c_anonymous__kernel_fsid_t { + pub val: [::c_int; 2], + } + pub struct ucred { pub pid: ::pid_t, pub uid: ::uid_t, @@ -615,6 +630,18 @@ s! { pub response: __u32, } + pub struct fanotify_event_info_header { + pub info_type: __u8, + pub pad: __u8, + pub len: __u16, + } + + pub struct fanotify_event_info_fid { + pub hdr: fanotify_event_info_header, + pub fsid: ::__kernel_fsid_t, + pub handle: [::c_uchar; 0], + } + pub struct sockaddr_vm { pub svm_family: ::sa_family_t, pub svm_reserved1: ::c_ushort,