Skip to content
Snippets Groups Projects
Commit 919ae09d authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix compilation on Redox

parent 3361b059
No related branches found
No related tags found
No related merge requests found
Pipeline #545 failed
#![no_std] #![no_std]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
#![feature(alloc)]
#![feature(allocator_api)] #![feature(allocator_api)]
//TODO #![feature(thread_local)] //TODO #![feature(thread_local)]
extern crate alloc;
#[cfg(all(not(feature = "no_std"), target_os = "linux"))] #[cfg(all(not(feature = "no_std"), target_os = "linux"))]
#[macro_use] #[macro_use]
extern crate sc; extern crate sc;
...@@ -11,15 +14,15 @@ extern crate sc; ...@@ -11,15 +14,15 @@ extern crate sc;
#[macro_use] #[macro_use]
pub extern crate syscall; pub extern crate syscall;
pub use alloc::*; pub use allocator::*;
#[cfg(not(feature = "ralloc"))] #[cfg(not(feature = "ralloc"))]
#[path = "alloc/dlmalloc.rs"] #[path = "allocator/dlmalloc.rs"]
mod alloc; mod allocator;
#[cfg(feature = "ralloc")] #[cfg(feature = "ralloc")]
#[path = "alloc/ralloc.rs"] #[path = "allocator/ralloc.rs"]
mod alloc; mod allocator;
pub use sys::*; pub use sys::*;
......
...@@ -23,7 +23,7 @@ pub fn e(sys: Result<usize, syscall::Error>) -> usize { ...@@ -23,7 +23,7 @@ pub fn e(sys: Result<usize, syscall::Error>) -> usize {
} }
pub fn brk(addr: *mut c_void) -> *mut c_void { pub fn brk(addr: *mut c_void) -> *mut c_void {
unsafe { syscall::brk(addr as usize) } as *mut c_void unsafe { syscall::brk(addr as usize).unwrap_or(0) as *mut c_void }
} }
pub fn chdir(path: *const c_char) -> c_int { pub fn chdir(path: *const c_char) -> 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