summary refs log tree commit diff
path: root/src/libstd/os.rs
AgeCommit message (Collapse)AuthorLines
2014-06-24auto merge of #14963 : w3ln4/rust/master, r=alexcrichtonbors-0/+4
The aim of these changes is not working out a generic bi-endianness architectures support but to allow people develop for little endian MIPS machines (issue #7190).
2014-06-24Added Mipsel architecture supportPawel Olzacki-0/+4
2014-06-18fix signatures of mmap-related functions from libcDaniel Micay-6/+5
2014-06-16Move `num_cpus` from `std::rt::util` to `std::os`. Closes #14707Jorge Aparicio-0/+15
2014-06-16std: Improve pipe() functionalityAlex Crichton-23/+34
* os::pipe() now returns IoResult<os::Pipe> * os::pipe() is now unsafe because it does not arrange for deallocation of file descriptors * os::Pipe fields are renamed from input to reader and out to write. * PipeStream::pair() has been added. This is a safe method to get a pair of pipes. * Dealing with pipes in native process bindings have been improved to be more robust in the face of failure and intermittent errors. This converts a few fail!() situations to Err situations. Closes #9458 cc #13538 Closes #14724 [breaking-change]
2014-06-12Basic iOS supportValerii Hiora-0/+81
2014-06-11auto merge of #14713 : darnuria/rust/Improve_std_os_documentation_#2, ↵bors-76/+140
r=alexcrichton Improving documentation, consistency, removes evils empty lines etc...
2014-06-12Improve docs and refactore std::os.Axel Viala-76/+140
2014-06-11rustc: Remove ~[T] from the languageAlex Crichton-2/+2
The following features have been removed * box [a, b, c] * ~[a, b, c] * box [a, ..N] * ~[a, ..N] * ~[T] (as a type) * deprecated_owned_vector lint All users of ~[T] should move to using Vec<T> instead.
2014-06-09std: Remove the as_utf16_p functionsAlex Crichton-31/+15
These functions are all much better expressed via RAII using the to_utf16() method on strings. This refactoring also takes this opportunity to properly handle when filenames aren't valid unicode when passed through to the windows I/O layer by properly returning I/O errors. All previous users of the `as_utf16_p` or `as_utf16_mut_p` functions will need to convert their code to using `foo.to_utf16().append_one(0)` to get a null-terminated utf16 string. [breaking-change]
2014-06-08core: Rename `container` mod to `collections`. Closes #12543Brian Anderson-1/+1
Also renames the `Container` trait to `Collection`. [breaking-change]
2014-06-08Fix spelling errors in comments.Joseph Crail-1/+1
2014-06-06std: Deal with fallout of rtio changesAlex Crichton-1/+1
2014-06-06Removing unused wrapper to libc::close.Axel Viala-6/+0
2014-06-05auto merge of #14641 : darnuria/rust/add_documentation_to_std_os, r=alexcrichtonbors-4/+57
Just opening a pull request for adding code examples and documentation to std::os. More to come soon.
2014-06-05Improve documentation on std::os::env.Axel Viala-2/+11
2014-06-05Adding examples and possible failures for getcwd.Axel Viala-2/+36
For both window and unix platforms.
2014-06-04Add code example to std::os::getenv for unix.Axel Viala-0/+10
2014-06-03std: Remove generics from Option::expectAlex Crichton-3/+1
This commit removes the <M: Any + Send> type parameter from Option::expect in favor of just taking a hard-coded `&str` argument. This allows this function to move into libcore. Previous code using strings with `expect` will continue to work, but code using this implicitly to transmit task failure will need to unwrap manually with a `match` statement. [breaking-change] Closes #14008
2014-05-30Add os::split_pathsAaron Turon-2/+94
Adds a platform-specific function, `split_paths` to the `os` module. This function can be used to parse PATH-like environment variables according to local platform conventions. Closes #14352.
2014-05-30windows: Allow snake_case errors for now.Kevin Butler-1/+2
2014-05-29std: Recreate a `rand` moduleAlex Crichton-1/+2
This commit shuffles around some of the `rand` code, along with some reorganization. The new state of the world is as follows: * The librand crate now only depends on libcore. This interface is experimental. * The standard library has a new module, `std::rand`. This interface will eventually become stable. Unfortunately, this entailed more of a breaking change than just shuffling some names around. The following breaking changes were made to the rand library: * Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which will return an infinite stream of random values. Previous behavior can be regained with `rng.gen_iter().take(n).collect()` * Rng::gen_ascii_str() was removed. This has been replaced with Rng::gen_ascii_chars() which will return an infinite stream of random ascii characters. Similarly to gen_iter(), previous behavior can be emulated with `rng.gen_ascii_chars().take(n).collect()` * {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all relied on being able to use an OSRng for seeding, but this is no longer available in librand (where these types are defined). To retain the same functionality, these types now implement the `Rand` trait so they can be generated with a random seed from another random number generator. This allows the stdlib to use an OSRng to create seeded instances of these RNGs. * Rand implementations for `Box<T>` and `@T` were removed. These seemed to be pretty rare in the codebase, and it allows for librand to not depend on liballoc. Additionally, other pointer types like Rc<T> and Arc<T> were not supported. If this is undesirable, librand can depend on liballoc and regain these implementations. * The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`, but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice structure now has a lifetime associated with it. * The `sample` method on `Rng` has been moved to a top-level function in the `rand` module due to its dependence on `Vec`. cc #13851 [breaking-change]
2014-05-28std: Remove format_strbuf!()Alex Crichton-2/+2
This was only ever a transitionary macro.
2014-05-27std: Rename strbuf operations to stringRicho Healey-13/+13
[breaking-change]
2014-05-25De-realstd os::argsKevin Ballard-14/+1
With the test runner using ::std::os::args(), and std::std::os now being a re-export of realstd::os, there's no more need for realstd stuff mucking up rt::args. Remove the one test of os::args(), as it's not very useful and it won't work anymore now that rt::args doesn't use realstd.
2014-05-25libstd: Remove unnecessary re-exports under std::stdKevin Ballard-5/+5
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-16/+16
[breaking-change]
2014-05-23core: Finish stabilizing the `mem` module.Alex Crichton-2/+2
* All of the *_val functions have gone from #[unstable] to #[stable] * The overwrite and zeroed functions have gone from #[unstable] to #[stable] * The uninit function is now deprecated, replaced by its stable counterpart, uninitialized [breaking-change]
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-26/+35
[breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-53/+65
2014-05-15Updates with core::fmt changesAlex Crichton-5/+5
1. Wherever the `buf` field of a `Formatter` was used, the `Formatter` is used instead. 2. The usage of `write_fmt` is minimized as much as possible, the `write!` macro is preferred wherever possible. 3. Usage of `fmt::write` is minimized, favoring the `write!` macro instead.
2014-05-14librand: Remove all uses of `~str` from `librand`Patrick Walton-3/+3
2014-05-13Use Get/FreeEnvironmentStringsW instead of Get/FreeEnvironmentStringsAPhil Ruffwind-9/+31
Changed libstd to use Get/FreeEnvironmentStringsW instead of Get/FreeEnvironmentStringsA to support Unicode environment variables.
2014-05-13Use CreateProcessW instead of CreateProcessAPhil Ruffwind-1/+5
Changed libnative to use CreateProcessW instead of CreateProcessA. In addition, the lpEnvironment parameter now uses Unicode. Added a helper function os::win32::as_mut_utf16_p, which does basically the same thing as os::win32::as_utf16_p except the pointer is mutable.
2014-05-12Test fixes from rollupAlex Crichton-2/+1
Closes #14163 (Fix typos in rustc manpage) Closes #14161 (Add the patch number to version strings. Closes #13289) Closes #14156 (rustdoc: Fix hiding implementations of traits) Closes #14152 (add shebang to scripts that have execute bit set) Closes #14150 (libcore: remove fails from slice.rs and remove duplicated length checking) Closes #14147 (Make ProcessOutput Eq, TotalEq, Clone) Closes #14142 (doc: updates rust manual (loop to continue)) Closes #14141 (doc: Update the linkage documentation) Closes #14139 (Remove an unnecessary .move_iter().collect()) Closes #14136 (Two minor fixes in parser.rs) Closes #14130 (Fixed typo in comments of driver.rs) Closes #14128 (Add `stat` method to `std::io::fs::File` to stat without a Path.) Closes #14114 (rustdoc: List macros in the sidebar) Closes #14113 (shootout-nbody improvement) Closes #14112 (Improved example code in Option) Closes #14104 (Remove reference to MutexArc) Closes #14087 (emacs: highlight `macro_name!` in macro invocations using [] delimiters)
2014-05-12Remove an unnecessary .move_iter().collect()Simon Sapin-1/+1
2014-05-09auto merge of #14054 : luqmana/rust/at, r=alexcrichtonbors-7/+9
`/data/local/tmp` seems to be more common.
2014-05-08libstd: Check TMPDIR for android as well and if not set use ↵Luqman Aden-7/+9
'/data/local/tmp' instead of '/data/tmp'.
2014-05-08Handle fallout in osKevin Ballard-24/+24
os::env(), os::args(), and related functions now use Vec<T> instead of ~[T].
2014-05-07Test fixes and rebase conflictsAlex Crichton-3/+5
2014-05-07core: Inherit possible string functionalityAlex Crichton-1/+1
This moves as much allocation as possible from teh std::str module into core::str. This includes essentially all non-allocating functionality, mostly iterators and slicing and such. This primarily splits the Str trait into only having the as_slice() method, adding a new StrAllocating trait to std::str which contains the relevant new allocation methods. This is a breaking change if any of the methods of "trait Str" were overriden. The old functionality can be restored by implementing both the Str and StrAllocating traits. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-2/+2
2014-04-25Cleaned up os::consts. The module only exposes constants for the target OS ↵Michael Darakananda-172/+130
and arch. Constants for other OS's and arch's must be defined manually. [breaking-change]
2014-04-19auto merge of #13613 : alexcrichton/rust/fix-freebsd-compile, r=brsonbors-3/+2
Ah, the wonders of not being gated on FreeBSD...
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-7/+7
2014-04-18std: Fix compiling on FreeBSDAlex Crichton-3/+2
Ah, the wonders of not being gated on FreeBSD...
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-25/+20
2014-04-18std: Make ~[T] no longer a growable vectorAlex Crichton-14/+11
This removes all resizability support for ~[T] vectors in preparation of DST. The only growable vector remaining is Vec<T>. In summary, the following methods from ~[T] and various functions were removed. Each method/function has an equivalent on the Vec type in std::vec unless otherwise stated. * slice::OwnedCloneableVector * slice::OwnedEqVector * slice::append * slice::append_one * slice::build (no replacement) * slice::bytes::push_bytes * slice::from_elem * slice::from_fn * slice::with_capacity * ~[T].capacity() * ~[T].clear() * ~[T].dedup() * ~[T].extend() * ~[T].grow() * ~[T].grow_fn() * ~[T].grow_set() * ~[T].insert() * ~[T].pop() * ~[T].push() * ~[T].push_all() * ~[T].push_all_move() * ~[T].remove() * ~[T].reserve() * ~[T].reserve_additional() * ~[T].reserve_exect() * ~[T].retain() * ~[T].set_len() * ~[T].shift() * ~[T].shrink_to_fit() * ~[T].swap_remove() * ~[T].truncate() * ~[T].unshift() * ~str.clear() * ~str.set_len() * ~str.truncate() Note that no other API changes were made. Existing apis that took or returned ~[T] continue to do so. [breaking-change]
2014-04-15std: Remove pub use globsBrian Anderson-11/+21
2014-04-04Fix fallout from std::libc separationCorey Richardson-2/+4