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