Skip to content
Snippets Groups Projects
Commit fc92d95b authored by Paul Sajna's avatar Paul Sajna
Browse files

this [u8] to c_char* is probably wrong

parent 95ed0b59
No related branches found
No related tags found
1 merge request!14implement some unistd
...@@ -58,7 +58,10 @@ pub fn ftruncate(fd: c_int, len: off_t) -> { ...@@ -58,7 +58,10 @@ pub fn ftruncate(fd: c_int, len: off_t) -> {
pub fn getcwd(buf: *mut c_char, size: size_t) -> { pub fn getcwd(buf: *mut c_char, size: size_t) -> {
// XXX: do something with size maybe // XXX: do something with size maybe
let rbuf = unsafe { c_str(buf) }; let rbuf = unsafe { c_str(buf) };
syscall::getcwd(rbuf)? as c_int syscall::getcwd(rbuf);
unsafe {
&*(rbuf as *mut [c_char])
}
} }
pub fn open(path: *const c_char, oflag: c_int, mode: mode_t) -> c_int { pub fn open(path: *const c_char, oflag: c_int, mode: mode_t) -> c_int {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment