File tree Expand file tree Collapse file tree 13 files changed +980
-9
lines changed Expand file tree Collapse file tree 13 files changed +980
-9
lines changed Original file line number Diff line number Diff line change @@ -473,21 +473,16 @@ pub mod f64;
473473pub mod thread;
474474pub mod ascii;
475475pub mod collections;
476- #[ cfg( not( target_os = "cloudabi" ) ) ]
477476pub mod env;
478477pub mod error;
479478pub mod ffi;
480- #[ cfg( not( target_os = "cloudabi" ) ) ]
481479pub mod fs;
482480pub mod io;
483- #[ cfg( not( target_os = "cloudabi" ) ) ]
484481pub mod net;
485482pub mod num;
486483pub mod os;
487484pub mod panic;
488- #[ cfg( not( target_os = "cloudabi" ) ) ]
489485pub mod path;
490- #[ cfg( not( target_os = "cloudabi" ) ) ]
491486pub mod process;
492487pub mod sync;
493488pub mod time;
Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ pub use sys:: cloudabi:: shims:: args:: * ;
12+
1113#[ allow( dead_code) ]
1214pub fn init ( _: isize , _: * const * const u8 ) { }
1315
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ pub mod time;
3434
3535mod abi;
3636
37+ mod shims;
38+ pub use self :: shims:: * ;
39+
3740#[ allow( dead_code) ]
3841pub fn init ( ) { }
3942
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ use ffi::CStr;
1212use libc:: { self , c_int} ;
1313use str;
1414
15+ pub use sys:: cloudabi:: shims:: os:: * ;
16+
1517pub fn errno ( ) -> i32 {
1618 extern "C" {
1719 #[ thread_local]
@@ -29,3 +31,7 @@ pub fn error_string(errno: i32) -> String {
2931 . unwrap ( )
3032 . to_owned ( )
3133}
34+
35+ pub fn exit ( code : i32 ) -> ! {
36+ unsafe { libc:: exit ( code as c_int ) }
37+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ use ffi:: OsString ;
12+
13+ pub struct Args ( ( ) ) ;
14+
15+ impl Args {
16+ pub fn inner_debug ( & self ) -> & [ OsString ] {
17+ & [ ]
18+ }
19+ }
20+
21+ impl Iterator for Args {
22+ type Item = OsString ;
23+ fn next ( & mut self ) -> Option < OsString > {
24+ None
25+ }
26+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
27+ ( 0 , Some ( 0 ) )
28+ }
29+ }
30+
31+ impl ExactSizeIterator for Args {
32+ fn len ( & self ) -> usize {
33+ 0
34+ }
35+ }
36+
37+ impl DoubleEndedIterator for Args {
38+ fn next_back ( & mut self ) -> Option < OsString > {
39+ None
40+ }
41+ }
42+
43+ pub fn args ( ) -> Args {
44+ Args ( ( ) )
45+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ pub mod os {
12+ pub const FAMILY : & ' static str = "cloudabi" ;
13+ pub const OS : & ' static str = "cloudabi" ;
14+ pub const DLL_PREFIX : & ' static str = "lib" ;
15+ pub const DLL_SUFFIX : & ' static str = ".so" ;
16+ pub const DLL_EXTENSION : & ' static str = "so" ;
17+ pub const EXE_SUFFIX : & ' static str = "" ;
18+ pub const EXE_EXTENSION : & ' static str = "" ;
19+ }
You can’t perform that action at this time.
0 commit comments