Skip to content

Commit 7559ba1

Browse files
committed
musl: Decommonize definition of fanotify_event_metadata
musl has its own definition of the fanotify_event_metadata struct and doesn't use the one from the Linux kernel. The difference here is that musl's mask field has the type unsigned long long, while the kernel uses __u64. This currently causes libc-test to fail to compile on musl targets. Linux: https://github.com/torvalds/linux/blob/master/include/uapi/linux/fanotify.h#L143 musl: https://git.musl-libc.org/cgit/musl/tree/include/sys/fanotify.h#n15 Signed-off-by: Jens Reidel <adrian@travitia.xyz>
1 parent 5303c3a commit 7559ba1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,7 @@ s! {
12201220
size: [u8; crate::__SIZEOF_PTHREAD_BARRIERATTR_T],
12211221
}
12221222

1223+
#[cfg(not(target_env = "musl"))]
12231224
#[repr(align(8))]
12241225
pub struct fanotify_event_metadata {
12251226
pub event_len: __u32,

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ impl siginfo_t {
122122
}
123123

124124
s! {
125+
#[repr(align(8))]
126+
pub struct fanotify_event_metadata {
127+
pub event_len: c_uint,
128+
pub vers: c_uchar,
129+
pub reserved: c_uchar,
130+
pub metadata_len: c_ushort,
131+
pub mask: c_ulonglong,
132+
pub fd: c_int,
133+
pub pid: c_int,
134+
}
135+
125136
// FIXME(1.0): This should not implement `PartialEq`
126137
#[allow(unpredictable_function_pointer_comparisons)]
127138
pub struct sigaction {

0 commit comments

Comments
 (0)