about summary refs log tree commit diff
path: root/src/libstd/sys/redox/ext
diff options
context:
space:
mode:
authorIan Douglas Scott <ian@iandouglasscott.com>2017-07-06 16:14:00 -0700
committerIan Douglas Scott <ian@iandouglasscott.com>2017-07-06 17:34:51 -0700
commit4d58b048a8b1ca9e2bd6907359ef9b4dc1f7382a (patch)
tree1d84f8e73526fbfc4a7dbdc955b285fbd2863ed7 /src/libstd/sys/redox/ext
parent696412de7e4e119f8536686c643621115b90c775 (diff)
Redox: add stat methods(); support is_symlink()
Diffstat (limited to 'src/libstd/sys/redox/ext')
-rw-r--r--src/libstd/sys/redox/ext/fs.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libstd/sys/redox/ext/fs.rs b/src/libstd/sys/redox/ext/fs.rs
index 4437cf43920..9a0d1e06da3 100644
--- a/src/libstd/sys/redox/ext/fs.rs
+++ b/src/libstd/sys/redox/ext/fs.rs
@@ -177,6 +177,8 @@ pub trait MetadataExt {
     #[stable(feature = "metadata_ext", since = "1.1.0")]
     fn mode(&self) -> u32;
     #[stable(feature = "metadata_ext", since = "1.1.0")]
+    fn nlink(&self) -> u64;
+    #[stable(feature = "metadata_ext", since = "1.1.0")]
     fn uid(&self) -> u32;
     #[stable(feature = "metadata_ext", since = "1.1.0")]
     fn gid(&self) -> u32;
@@ -194,6 +196,10 @@ pub trait MetadataExt {
     fn ctime(&self) -> i64;
     #[stable(feature = "metadata_ext", since = "1.1.0")]
     fn ctime_nsec(&self) -> i64;
+    #[stable(feature = "metadata_ext", since = "1.1.0")]
+    fn blksize(&self) -> u64;
+    #[stable(feature = "metadata_ext", since = "1.1.0")]
+    fn blocks(&self) -> u64;
 }
 
 #[stable(feature = "metadata_ext", since = "1.1.0")]
@@ -207,6 +213,9 @@ impl MetadataExt for fs::Metadata {
     fn mode(&self) -> u32 {
         self.as_inner().as_inner().st_mode as u32
     }
+    fn nlink(&self) -> u64 {
+        self.as_inner().as_inner().st_nlink as u64
+    }
     fn uid(&self) -> u32 {
         self.as_inner().as_inner().st_uid as u32
     }
@@ -234,6 +243,12 @@ impl MetadataExt for fs::Metadata {
     fn ctime_nsec(&self) -> i64 {
         self.as_inner().as_inner().st_ctime_nsec as i64
     }
+    fn blksize(&self) -> u64 {
+        self.as_inner().as_inner().st_blksize as u64
+    }
+    fn blocks(&self) -> u64 {
+        self.as_inner().as_inner().st_blocks as u64
+    }
 }
 
 /// Add special Redox types (block/char device, fifo and socket)