瀏覽代碼

增加fstat系统调用 (#12)

* 增加fstat系统调用
houmkh 1 年之前
父節點
當前提交
dcd3e31223
共有 4 個文件被更改,包括 8 次插入4 次删除
  1. 5 0
      .vscode/settings.json
  2. 0 1
      Cargo.lock
  3. 1 2
      Cargo.toml
  4. 2 1
      src/platform/dragonos/mod.rs

+ 5 - 0
.vscode/settings.json

@@ -0,0 +1,5 @@
+{
+    "rust-analyzer.linkedProjects": [
+        "./Cargo.toml"
+    ]
+}

+ 0 - 1
Cargo.lock

@@ -111,7 +111,6 @@ version = "0.1.0"
 [[package]]
 name = "dragonos-dsc"
 version = "0.0.1"
-source = "git+https://github.com/DragonOS-Community/dsc.git?rev=194f741#194f741bc36411c2ce1579b17ba010951312730d"
 
 [[package]]
 name = "errno"

+ 1 - 2
Cargo.toml

@@ -42,8 +42,7 @@ sc = "0.2.3"
 
 [target.'cfg(target_os = "dragonos")'.dependencies]
 # Development
-# dragonos-dsc = { path = "本地存放dsc的代码的路径" }
-dragonos-dsc = { git = "https://github.com/DragonOS-Community/dsc.git", rev = "182c9bc" }
+dragonos-dsc = { git = "https://github.com/DragonOS-Community/dsc.git", rev = "f57e668" }
 
 [target.'cfg(target_os = "redox")'.dependencies]
 redox_syscall = "0.3"

+ 2 - 1
src/platform/dragonos/mod.rs

@@ -163,7 +163,8 @@ impl Pal for Sys {
         // let empty = b"\0";
         // let empty_ptr = empty.as_ptr() as *const c_char;
         // e(unsafe { syscall!(NEWFSTATAT, fildes, empty_ptr, buf, AT_EMPTY_PATH) }) as c_int
-        unimplemented!()
+        // unimplemented!()
+        e(unsafe { syscall!(SYS_FSTAT, fildes, buf) }) as c_int
     }
 
     fn fstatvfs(fildes: c_int, buf: *mut statvfs) -> c_int {