Skip to content

Commit 0bef8ef

Browse files
committed
review: avoid #[cfg] attrs, move fanotify_mark to subdirs.
1 parent 2eab0f8 commit 0bef8ef

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,13 @@ extern "C" {
11981198
pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
11991199
#[link_name = "ntp_gettimex"]
12001200
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
1201+
pub fn fanotify_mark(
1202+
fd: ::c_int,
1203+
flags: ::c_uint,
1204+
mask: u64,
1205+
dirfd: ::c_int,
1206+
path: *const ::c_char,
1207+
) -> ::c_int;
12011208
}
12021209

12031210
#[link(name = "util")]

src/unix/linux_like/linux/mod.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3392,26 +3392,6 @@ extern "C" {
33923392
mask: u32,
33933393
) -> ::c_int;
33943394
pub fn fanotify_init(flags: ::c_uint, event_f_flags: ::c_uint) -> ::c_int;
3395-
3396-
#[cfg(not(target_env = "musl"))]
3397-
pub fn fanotify_mark(
3398-
fd: ::c_int,
3399-
flags: ::c_uint,
3400-
mask: u64,
3401-
dirfd: ::c_int,
3402-
path: *const ::c_char,
3403-
) -> ::c_int;
3404-
// Musl targets need the `mask` argument of `fanotify_mark` be specified `::c_ulonglong`
3405-
// instead of `u64` or there will be a type mismatch between `long long unsigned int` and the
3406-
// expected `uint64_t`.
3407-
#[cfg(target_env = "musl")]
3408-
pub fn fanotify_mark(
3409-
fd: ::c_int,
3410-
flags: ::c_uint,
3411-
mask: ::c_ulonglong,
3412-
dirfd: ::c_int,
3413-
path: *const ::c_char,
3414-
) -> ::c_int;
34153395
}
34163396

34173397
cfg_if! {

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,16 @@ extern "C" {
420420
needle: *const ::c_void,
421421
needlelen: ::size_t,
422422
) -> *mut ::c_void;
423+
// Musl targets need the `mask` argument of `fanotify_mark` be specified
424+
// `::c_ulonglong` instead of `u64` or there will be a type mismatch between
425+
// `long long unsigned int` and the expected `uint64_t`.
426+
pub fn fanotify_mark(
427+
fd: ::c_int,
428+
flags: ::c_uint,
429+
mask: ::c_ulonglong,
430+
dirfd: ::c_int,
431+
path: *const ::c_char,
432+
) -> ::c_int;
423433
}
424434

425435
cfg_if! {

0 commit comments

Comments
 (0)