@@ -250,15 +250,15 @@ impl FanotifyFidRecord {
250250 /// The filesystem id where this event occurred. The value this method returns
251251 /// differs depending on the host system. Please read the statfs(2) documentation
252252 /// 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>
254254 pub fn filesystem_id ( & self ) -> libc:: __kernel_fsid_t {
255255 self . 0 . fsid
256256 }
257257
258258 /// The file handle for the filesystem object where the event occurred. The handle is
259259 /// represented as a 0-length u8 array, but it actually points to variable-length
260260 /// 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>
262262 pub fn handle ( & self ) -> [ u8 ; 0 ] {
263263 self . 0 . handle
264264 }
@@ -270,8 +270,10 @@ impl FanotifyFidRecord {
270270#[ derive( Debug , Eq , Hash , PartialEq ) ]
271271#[ repr( transparent) ]
272272#[ allow( missing_copy_implementations) ]
273+ #[ cfg( target_env = "gnu" ) ]
273274pub struct FanotifyErrorRecord ( libc:: fanotify_event_info_error ) ;
274275
276+ #[ cfg( target_env = "gnu" ) ]
275277impl FanotifyErrorRecord {
276278 /// Errno of the FAN_FS_ERROR that occurred.
277279 pub fn err ( & self ) -> Errno {
@@ -292,8 +294,10 @@ impl FanotifyErrorRecord {
292294#[ derive( Debug , Eq , Hash , PartialEq ) ]
293295#[ repr( transparent) ]
294296#[ allow( missing_copy_implementations) ]
297+ #[ cfg( target_env = "gnu" ) ]
295298pub struct FanotifyPidfdRecord ( libc:: fanotify_event_info_pidfd ) ;
296299
300+ #[ cfg( target_env = "gnu" ) ]
297301impl FanotifyPidfdRecord {
298302 /// The process file descriptor that refers to the process responsible for
299303 /// generating this event. If the underlying pidfd_create fails, `None` is returned.
@@ -310,6 +314,7 @@ impl FanotifyPidfdRecord {
310314 }
311315}
312316
317+ #[ cfg( target_env = "gnu" ) ]
313318impl Drop for FanotifyPidfdRecord {
314319 fn drop ( & mut self ) {
315320 if self . 0 . pidfd == libc:: FAN_NOFD {
@@ -339,12 +344,14 @@ pub enum FanotifyInfoRecord {
339344 /// A [`libc::fanotify_event_info_error`] event was recieved.
340345 /// This occurs when a FAN_FS_ERROR occurs, indicating an error with
341346 /// the watch filesystem object. (such as a bad file or bad link lookup)
347+ #[ cfg( target_env = "gnu" ) ]
342348 Error ( FanotifyErrorRecord ) ,
343349
344350 /// A [`libc::fanotify_event_info_pidfd`] event was recieved, usually as
345351 /// a result of passing [`InitFlags::FAN_REPORT_PIDFD`] into [`Fanotify::init`].
346352 /// The containing struct includes a `pidfd` for reliably determining
347353 /// whether the process responsible for generating an event has been recycled or terminated
354+ #[ cfg( target_env = "gnu" ) ]
348355 Pidfd ( FanotifyPidfdRecord ) ,
349356}
350357
@@ -610,6 +617,7 @@ impl Fanotify {
610617 ) ;
611618 Some ( FanotifyInfoRecord :: Fid ( FanotifyFidRecord ( record) ) )
612619 }
620+ #[ cfg( target_env = "gnu" ) ]
613621 libc:: FAN_EVENT_INFO_TYPE_ERROR => {
614622 let record = self
615623 . get_struct :: < libc:: fanotify_event_info_error > (
@@ -621,6 +629,7 @@ impl Fanotify {
621629 record,
622630 ) ) )
623631 }
632+ #[ cfg( target_env = "gnu" ) ]
624633 libc:: FAN_EVENT_INFO_TYPE_PIDFD => {
625634 let record = self
626635 . get_struct :: < libc:: fanotify_event_info_pidfd > (
0 commit comments