diff --git a/libc-test/build.rs b/libc-test/build.rs index 2f45523187a51..8000bc18adaff 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4369,7 +4369,11 @@ fn test_linux(target: &str) { // the `ifr_ifrn` field is an anonymous union (struct_ == "iwreq" && field == "ifr_ifrn") || // the `key` field is a zero-sized array - (struct_ == "iw_encode_ext" && field == "key") + (struct_ == "iw_encode_ext" && field == "key") || + // 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 79c051f4c7c50..e1ce4b2103956 100644 --- a/libc-test/semver/linux-gnu.txt +++ b/libc-test/semver/linux-gnu.txt @@ -621,6 +621,8 @@ dlinfo dlmopen endutxent explicit_bzero +fanotify_event_info_error +fanotify_event_info_pidfd fgetgrent_r fgetspent_r futimes diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index c93940b82e485..fa21721d32a3e 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -3537,6 +3537,7 @@ execvpe faccessat fallocate fallocate64 +fanotify_event_info_fid fanotify_event_metadata fanotify_init fanotify_mark diff --git a/src/unix/linux_like/linux/align.rs b/src/unix/linux_like/linux/align.rs index 1036e23dc8f09..5792af14d9322 100644 --- a/src/unix/linux_like/linux/align.rs +++ b/src/unix/linux_like/linux/align.rs @@ -63,6 +63,13 @@ macro_rules! expand_align { pub fd: ::c_int, pub pid: ::c_int, } + + #[repr(align(2))] + pub struct fanotify_event_info_header { + pub info_type: __u8, + pub pad: __u8, + pub len: __u16, + } } s_no_extra_traits! { diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index 1f742a7d88ee1..642c3f7c4e310 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -453,6 +453,17 @@ s! { pub aio_flags: ::__u32, pub aio_resfd: ::__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 2ce09ed168df8..d03c52bcb277f 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,12 @@ s! { pub response: __u32, } + 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,