@@ -504,6 +504,8 @@ pub enum FcntlArg<'a> {
504
504
F_GET_SEALS ,
505
505
#[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
506
506
F_FULLFSYNC ,
507
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
508
+ F_BARRIERFSYNC ,
507
509
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
508
510
F_GETPIPE_SZ ,
509
511
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
@@ -512,6 +514,8 @@ pub enum FcntlArg<'a> {
512
514
F_GETPATH ( & ' a mut PathBuf ) ,
513
515
#[ cfg( all( target_os = "freebsd" , target_arch = "x86_64" ) ) ]
514
516
F_KINFO ( & ' a mut PathBuf ) ,
517
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
518
+ F_GETPATH_NOFIRMLINK ( & ' a mut PathBuf ) ,
515
519
// TODO: Rest of flags
516
520
}
517
521
@@ -568,6 +572,8 @@ pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> {
568
572
F_GET_SEALS => libc:: fcntl( fd, libc:: F_GET_SEALS ) ,
569
573
#[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
570
574
F_FULLFSYNC => libc:: fcntl( fd, libc:: F_FULLFSYNC ) ,
575
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
576
+ F_BARRIERFSYNC => libc:: fcntl( fd, libc:: F_BARRIERFSYNC ) ,
571
577
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
572
578
F_GETPIPE_SZ => libc:: fcntl( fd, libc:: F_GETPIPE_SZ ) ,
573
579
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
@@ -593,6 +599,15 @@ pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> {
593
599
* path = PathBuf :: from( OsString :: from( optr. to_str( ) . unwrap( ) ) ) ;
594
600
return Ok ( ok_res)
595
601
} ,
602
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
603
+ F_GETPATH_NOFIRMLINK ( path) => {
604
+ let mut buffer = vec![ 0 ; libc:: PATH_MAX as usize ] ;
605
+ let res = libc:: fcntl( fd, libc:: F_GETPATH_NOFIRMLINK , buffer. as_mut_ptr( ) ) ;
606
+ let ok_res = Errno :: result( res) ?;
607
+ let optr = CStr :: from_bytes_until_nul( & buffer) . unwrap( ) ;
608
+ * path = PathBuf :: from( OsString :: from( optr. to_str( ) . unwrap( ) ) ) ;
609
+ return Ok ( ok_res)
610
+ } ,
596
611
}
597
612
} ;
598
613
0 commit comments