File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,10 @@ pub fn stat(p: &Path) -> io::Result<FileAttr> {
447
447
}
448
448
449
449
pub fn lstat ( p : & Path ) -> io:: Result < FileAttr > {
450
- stat ( p)
450
+ let fd = cvt ( syscall:: open ( p. to_str ( ) . unwrap ( ) ,
451
+ syscall:: O_CLOEXEC | syscall:: O_STAT | syscall:: O_NOFOLLOW ) ) ?;
452
+ let file = File ( FileDesc :: new ( fd) ) ;
453
+ file. file_attr ( )
451
454
}
452
455
453
456
pub fn canonicalize ( p : & Path ) -> io:: Result < PathBuf > {
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ pub const O_EXCL: usize = 0x0800_0000;
55
55
pub const O_DIRECTORY : usize = 0x1000_0000 ;
56
56
pub const O_STAT : usize = 0x2000_0000 ;
57
57
pub const O_SYMLINK : usize = 0x4000_0000 ;
58
+ pub const O_NOFOLLOW : usize = 0x8000_0000 ;
58
59
pub const O_ACCMODE : usize = O_RDONLY | O_WRONLY | O_RDWR ;
59
60
60
61
pub const SEEK_SET : usize = 0 ;
You can’t perform that action at this time.
0 commit comments