@@ -250,15 +250,15 @@ impl FanotifyFidRecord {
250
250
/// The filesystem id where this event occurred. The value this method returns
251
251
/// differs depending on the host system. Please read the statfs(2) documentation
252
252
/// for more information:
253
- /// https://man7.org/linux/man-pages/man2/statfs.2.html#VERSIONS
253
+ /// < https://man7.org/linux/man-pages/man2/statfs.2.html#VERSIONS>
254
254
pub fn filesystem_id ( & self ) -> libc:: __kernel_fsid_t {
255
255
self . 0 . fsid
256
256
}
257
257
258
258
/// The file handle for the filesystem object where the event occurred. The handle is
259
259
/// represented as a 0-length u8 array, but it actually points to variable-length
260
260
/// file_handle struct.For more information:
261
- /// https://man7.org/linux/man-pages/man2/open_by_handle_at.2.html
261
+ /// < https://man7.org/linux/man-pages/man2/open_by_handle_at.2.html>
262
262
pub fn handle ( & self ) -> [ u8 ; 0 ] {
263
263
self . 0 . handle
264
264
}
@@ -270,8 +270,10 @@ impl FanotifyFidRecord {
270
270
#[ derive( Debug , Eq , Hash , PartialEq ) ]
271
271
#[ repr( transparent) ]
272
272
#[ allow( missing_copy_implementations) ]
273
+ #[ cfg( target_env = "gnu" ) ]
273
274
pub struct FanotifyErrorRecord ( libc:: fanotify_event_info_error ) ;
274
275
276
+ #[ cfg( target_env = "gnu" ) ]
275
277
impl FanotifyErrorRecord {
276
278
/// Errno of the FAN_FS_ERROR that occurred.
277
279
pub fn err ( & self ) -> Errno {
@@ -292,8 +294,10 @@ impl FanotifyErrorRecord {
292
294
#[ derive( Debug , Eq , Hash , PartialEq ) ]
293
295
#[ repr( transparent) ]
294
296
#[ allow( missing_copy_implementations) ]
297
+ #[ cfg( target_env = "gnu" ) ]
295
298
pub struct FanotifyPidfdRecord ( libc:: fanotify_event_info_pidfd ) ;
296
299
300
+ #[ cfg( target_env = "gnu" ) ]
297
301
impl FanotifyPidfdRecord {
298
302
/// The process file descriptor that refers to the process responsible for
299
303
/// generating this event. If the underlying pidfd_create fails, `None` is returned.
@@ -310,6 +314,7 @@ impl FanotifyPidfdRecord {
310
314
}
311
315
}
312
316
317
+ #[ cfg( target_env = "gnu" ) ]
313
318
impl Drop for FanotifyPidfdRecord {
314
319
fn drop ( & mut self ) {
315
320
if self . 0 . pidfd == libc:: FAN_NOFD {
@@ -339,12 +344,14 @@ pub enum FanotifyInfoRecord {
339
344
/// A [`libc::fanotify_event_info_error`] event was recieved.
340
345
/// This occurs when a FAN_FS_ERROR occurs, indicating an error with
341
346
/// the watch filesystem object. (such as a bad file or bad link lookup)
347
+ #[ cfg( target_env = "gnu" ) ]
342
348
Error ( FanotifyErrorRecord ) ,
343
349
344
350
/// A [`libc::fanotify_event_info_pidfd`] event was recieved, usually as
345
351
/// a result of passing [`InitFlags::FAN_REPORT_PIDFD`] into [`Fanotify::init`].
346
352
/// The containing struct includes a `pidfd` for reliably determining
347
353
/// whether the process responsible for generating an event has been recycled or terminated
354
+ #[ cfg( target_env = "gnu" ) ]
348
355
Pidfd ( FanotifyPidfdRecord ) ,
349
356
}
350
357
@@ -610,6 +617,7 @@ impl Fanotify {
610
617
) ;
611
618
Some ( FanotifyInfoRecord :: Fid ( FanotifyFidRecord ( record) ) )
612
619
}
620
+ #[ cfg( target_env = "gnu" ) ]
613
621
libc:: FAN_EVENT_INFO_TYPE_ERROR => {
614
622
let record = self
615
623
. get_struct :: < libc:: fanotify_event_info_error > (
@@ -621,6 +629,7 @@ impl Fanotify {
621
629
record,
622
630
) ) )
623
631
}
632
+ #[ cfg( target_env = "gnu" ) ]
624
633
libc:: FAN_EVENT_INFO_TYPE_PIDFD => {
625
634
let record = self
626
635
. get_struct :: < libc:: fanotify_event_info_pidfd > (
0 commit comments