about summary refs log tree commit diff
path: root/src/libstd/sys/redox
AgeCommit message (Collapse)AuthorLines
2019-02-02deprecate things a bit slowerRalf Jung-1/+1
2019-02-01also replace before_exec by pre_exec on redoxRalf Jung-5/+25
2019-01-26Replace deprecated ATOMIC_INIT constsMark Rousskov-2/+2
2019-01-13Cosmetic improvementsAlexander Regueiro-2/+1
2019-01-07std: Force `Instant::now()` to be monotonicAlex Crichton-0/+8
This commit is an attempt to force `Instant::now` to be monotonic through any means possible. We tried relying on OS/hardware/clock implementations, but those seem buggy enough that we can't rely on them in practice. This commit implements the same hammer Firefox recently implemented (noted in #56612) which is to just keep whatever the lastest `Instant::now()` return value was in memory, returning that instead of the OS looks like it's moving backwards. Closes #48514 Closes #49281 cc #51648 cc #56560 Closes #56612 Closes #56940
2018-12-25Remove licensesMark Rousskov-479/+0
2018-12-21Auto merge of #56813 - oli-obk:main_đź§¶, r=pnkfelixbors-1/+0
Always run rustc in a thread cc @ishitatsuyuki @eddyb r? @pnkfelix [Previously](https://github.com/rust-lang/rust/pull/48575) we moved to only producing threads when absolutely necessary. Even before we opted to only create threads in some cases, which [is unsound](https://github.com/rust-lang/rust/pull/48575#issuecomment-380635967) due to the way we use thread local storage.
2018-12-14Remove dead codeOliver Scherer-1/+0
2018-12-13Add checked_sub for Instant and SystemTimeLinus Färnstrand-13/+11
2018-12-13Add checked_add method to Instant time typeLinus Färnstrand-10/+2
2018-12-06Change sys::Thread::new to take the thread entry as Box<dyn FnBox() + 'static>ĚŁJethro Beekman-1/+2
2018-12-06Refactor net::each_addr/lookup_host to forward error from resolveJethro Beekman-67/+102
2018-12-06Refactor stderr_prints_nothing into a more modular functionJethro Beekman-2/+2
2018-12-04cleanup: remove static lifetimes from consts in libstdljedrz-9/+9
2018-11-25Auto merge of #55527 - sgeisler:time-checked-add, r=sfacklerbors-6/+12
Implement checked_add_duration for SystemTime [Original discussion on the rust user forum](https://users.rust-lang.org/t/std-systemtime-misses-a-checked-add-function/21785) Since `SystemTime` is opaque there is no way to check if the result of an addition will be in bounds. That makes the `Add<Duration>` trait completely unusable with untrusted data. This is a big problem because adding a `Duration` to `UNIX_EPOCH` is the standard way of constructing a `SystemTime` from a unix timestamp. This PR implements `checked_add_duration(&self, &Duration) -> Option<SystemTime>` for `std::time::SystemTime` and as a prerequisite also for all platform specific time structs. This also led to the refactoring of many `add_duration(&self, &Duration) -> SystemTime` functions to avoid redundancy (they now unwrap the result of `checked_add_duration`). Some basic unit tests for the newly introduced function were added too. I wasn't sure which stabilization attribute to add to the newly introduced function, so I just chose `#[stable(feature = "time_checked_add", since = "1.32.0")]` for now to make it compile. Please let me know how I should change it or if I violated any other conventions. P.S.: I could only test on Linux so far, so I don't necessarily expect it to compile for all platforms.
2018-11-15use ? operator instead of matchSebastian Geisler-10/+3
2018-11-15Implement checked_add_duration for SystemTimeSebastian Geisler-6/+19
Since SystemTime is opaque there is no way to check if the result of an addition will be in bounds. That makes the Add<Duration> trait completely unusable with untrusted data. This is a big problem because adding a Duration to UNIX_EPOCH is the standard way of constructing a SystemTime from a unix timestamp. This commit implements checked_add_duration(&self, &Duration) -> Option<SystemTime> for std::time::SystemTime and as a prerequisite also for all platform specific time structs. This also led to the refactoring of many add_duration(&self, &Duration) -> SystemTime functions to avoid redundancy (they now unwrap the result of checked_add_duration). Some basic unit tests for the newly introduced function were added too.
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-3/+3
fix various typos in doc comments
2018-11-15Rollup merge of #55182 - jD91mZM2:rebased, r=alexcrichtonPietro Albini-63/+235
Redox: Update to new changes These are all cherry-picked from our fork: - Remove the `env:` scheme - Update `execve` system call to `fexec` - Interpret shebangs: these are no longer handled by the kernel, which like usual tries to be as minimal as possible
2018-11-13fix various typos in doc commentsAndy Russell-3/+3
2018-11-11std: Delete the `alloc_system` crateAlex Crichton-0/+2
This commit deletes the `alloc_system` crate from the standard distribution. This unstable crate is no longer needed in the modern stable global allocator world, but rather its functionality is folded directly into the standard library. The standard library was already the only stable location to access this crate, and as a result this should not affect any stable code.
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-5/+5
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-06refactor: use shorthand fieldsteresy-5/+5
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-1/+1
2018-10-18Fix tidy checksjD91mZM2-1/+1
2018-10-18Revert liblibc submodule urljD91mZM2-7/+2
2018-10-18Interpret shebangs on redoxjD91mZM2-14/+80
This is no longer handled on the kernel side
2018-10-18Don't forget to close executable fileJeremy Soller-1/+2
2018-10-18Remove unused type parameterJeremy Soller-1/+1
2018-10-18Update to new system calls and enviromental variablesJeremy Soller-57/+167
2018-08-29Replace usages of 'bad_style' with 'nonstandard_style'.Corey Farwell-1/+1
`bad_style` is being deprecated in favor of `nonstandard_style`: - https://github.com/rust-lang/rust/issues/41646
2018-08-16std: stop backtracing when the frames are fullJosh Stone-8/+10
2018-08-08Use repr(align(x)) for redox in6_addrLinus Färnstrand-1/+1
2018-07-29Auto merge of #52738 - ljedrz:push_to_extend, r=eddybbors-5/+6
Replace push loops with extend() where possible Or set the vector capacity where I couldn't do it. According to my [simple benchmark](https://gist.github.com/ljedrz/568e97621b749849684c1da71c27dceb) `extend`ing a vector can be over **10 times** faster than `push`ing to it in a loop: 10 elements (6.1 times faster): ``` test bench_extension ... bench: 75 ns/iter (+/- 23) test bench_push_loop ... bench: 458 ns/iter (+/- 142) ``` 100 elements (11.12 times faster): ``` test bench_extension ... bench: 87 ns/iter (+/- 26) test bench_push_loop ... bench: 968 ns/iter (+/- 3,528) ``` 1000 elements (11.04 times faster): ``` test bench_extension ... bench: 311 ns/iter (+/- 9) test bench_push_loop ... bench: 3,436 ns/iter (+/- 233) ``` Seems like a good idea to use `extend` as much as possible.
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-5/+6
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-1/+1
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-3/+3
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-27Prefer to_string() to format!()ljedrz-1/+1
2018-07-25Merge remote-tracking branches 'ljedrz/dyn_libcore', 'ljedrz/dyn_libstd' and ↵Tatsuyuki Ishi-1/+1
'ljedrz/dyn_libterm' into dyn-rollup
2018-07-25Add missing dynTatsuyuki Ishi-2/+2
2018-07-24Rollup merge of #52656 - jD91mZM2:stablize-uds, r=alexcrichtonMark Rousskov-1/+41
Stablize Redox Unix Sockets I don't know if I did this correctly, but I basically spammed the `#[stable]` attribute everywhere :^)
2018-07-24Stablize Redox Unix SocketsjD91mZM2-1/+41
2018-07-23Change single char str patterns to charsljedrz-2/+2
2018-07-13Fix redox libstd leftoverTatsuyuki Ishi-2/+2
2018-07-10Add missing `dyn` for cloudabi, redox, unix and wasmljedrz-1/+1
2018-07-08Delete leftover filesjD91mZM2-252/+0
2018-07-07Add is_unnamedjD91mZM2-0/+27
2018-07-07Revert unification of interfacesjD91mZM2-4/+692
2018-07-03Remove stability attributes on private types and leftover docsjD91mZM2-2/+0
2018-06-27Add is_unnamed on redoxjD91mZM2-22/+26