about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-12 17:04:14 +0000
committerbors <bors@rust-lang.org>2017-07-12 17:04:14 +0000
commitf85579d4a2c342654f9b158fafd565eb159fdb59 (patch)
treee0ab8d41914e967769ee6422ad434d85c9fbcc31 /src/libstd/sys
parentb2b19ec92e233b7f91617e4cc2130e70d6e7a5fd (diff)
parent388fce9dab429e2cc90588727ae07a4c878bd7b3 (diff)
downloadrust-f85579d4a2c342654f9b158fafd565eb159fdb59.tar.gz
rust-f85579d4a2c342654f9b158fafd565eb159fdb59.zip
Auto merge of #43181 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 8 pull requests

- Successful merges: #42670, #42826, #43000, #43011, #43098, #43100, #43136, #43137
- Failed merges:
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/redox/ext/fs.rs15
-rw-r--r--src/libstd/sys/redox/fs.rs4
2 files changed, 17 insertions, 2 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)
diff --git a/src/libstd/sys/redox/fs.rs b/src/libstd/sys/redox/fs.rs
index 4dcaec6edb8..87e50c40148 100644
--- a/src/libstd/sys/redox/fs.rs
+++ b/src/libstd/sys/redox/fs.rs
@@ -119,10 +119,10 @@ impl FilePermissions {
 impl FileType {
     pub fn is_dir(&self) -> bool { self.is(syscall::MODE_DIR) }
     pub fn is_file(&self) -> bool { self.is(syscall::MODE_FILE) }
-    pub fn is_symlink(&self) -> bool { false /*FIXME: Implement symlink mode*/ }
+    pub fn is_symlink(&self) -> bool { self.is(syscall::MODE_SYMLINK) }
 
     pub fn is(&self, mode: u16) -> bool {
-        self.mode & (syscall::MODE_DIR | syscall::MODE_FILE) == mode
+        self.mode & syscall::MODE_TYPE == mode
     }
 }