diff --git a/libc-test/build.rs b/libc-test/build.rs index eeb119e9549a9..da12acade8f00 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3700,6 +3700,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 @@ -4449,7 +4452,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 f775994cd6725..5b079941bb970 100644 --- a/libc-test/semver/linux-gnu.txt +++ b/libc-test/semver/linux-gnu.txt @@ -628,6 +628,9 @@ dlinfo dlmopen endutxent explicit_bzero +fanotify_event_info_error +fanotify_event_info_header +fanotify_event_info_pidfd fgetgrent_r fgetspent_r futimes diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 2e928030486d4..402241df1d033 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -3540,6 +3540,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 a7dd919399fd9..5a350b7a57d84 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -491,6 +491,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 a47d0618ab230..616e2e7c7d466 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; @@ -590,6 +591,10 @@ s! { 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, @@ -657,6 +662,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,