Browse Source

Add Gettimeofday support for DragonOS(#11)

* gettimeofday

* 还原路径

* 解决未能正确填写dsc的revision的问题
houmkh 1 year ago
parent
commit
e929b475c2
2 changed files with 3 additions and 4 deletions
  1. 2 2
      Cargo.toml
  2. 1 2
      src/platform/dragonos/mod.rs

+ 2 - 2
Cargo.toml

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

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

@@ -308,8 +308,7 @@ impl Pal for Sys {
     }
 
     fn gettimeofday(tp: *mut timeval, tzp: *mut timezone) -> c_int {
-        // e(unsafe { syscall!(GETTIMEOFDAY, tp, tzp) }) as c_int
-        unimplemented!()
+        e(unsafe { syscall!(SYS_GETTIMEOFDAY, tp, tzp) }) as c_int
     }
 
     fn getuid() -> uid_t {